Fixup fromcvs/togit conversion
[pkgsrcv2.git] / misc / rubygems / Makefile
1 # $NetBSD: Makefile,v 1.51 2013/06/11 14:55:54 taca Exp $
2
3 DISTNAME=       rubygems-2.0.3
4 PKGREVISION=    1
5 CATEGORIES=     misc ruby
6 MASTER_SITES=   http://production.cf.rubygems.org/rubygems/
7 EXTRACT_SUFX=   .tgz
8
9 MAINTAINER=     taca@NetBSD.org
10 HOMEPAGE=       https://rubygems.org/
11 COMMENT=        Ruby standard for publishing and managing third party libraries
12 LICENSE=        gnu-gpl-v2 OR ruby-license
13
14 CONFLICTS+=     rubygems-[0-9]*
15
16 .include "../../mk/bsd.prefs.mk"
17
18 NO_CONFIGURE=   yes
19 NO_BUILD=       yes
20
21 REPLACE_RUBY_DIRS=      bin
22 REPLACE_RUBY_PAT=       [a-z]*
23
24 GEM_DOCDIR=     ${GEM_HOME}/doc/${DISTNAME}
25
26 REQD_DIRS=      ${GEM_HOME:H}
27 REQD_DIRS+=     ${GEM_HOME}
28 REQD_DIRS+=     ${GEM_HOME}/cache
29 REQD_DIRS+=     ${GEM_HOME}/doc
30 REQD_DIRS+=     ${GEM_HOME}/gems
31 REQD_DIRS+=     ${GEM_HOME}/specifications
32
33 SUBST_CLASSES+=         conf
34 SUBST_STAGE.conf=       pre-install
35 SUBST_FILES.conf=       lib/rubygems/config_file.rb
36 SUBST_SED.conf=         -e "s|@PKG_SYSCONFDIR@|${PKG_SYSCONFDIR}|g"
37 SUBST_MESSAGE.conf=     Fixing configuration files.
38
39 FILES_SUBST+=           RUBYGEM_NAME=${RUBYGEM_NAME}
40
41 # Generate a dynamic PLIST for the rubygems documentation directory.
42 GENERATE_PLIST+=        \
43         ${ECHO} "@comment The following lines are automatically generated." && \
44         cd ${DESTDIR}${PREFIX} && \
45             if [ -d ${GEM_DOCDIR:S|${PREFIX}/||} ]; then \
46                 ${FIND} ${GEM_DOCDIR:S|${PREFIX}/||} \! -type d -print | \
47                 ${SORT}; \
48             else \
49                 :; \
50             fi
51
52 # Force the Gem repository to be under ${DESTDIR}.  This is harmless
53 # because this package depends on no other gems.
54 #
55 INSTALL_ENV+=           GEM_HOME=${DESTDIR}${PREFIX}/${GEM_HOME}
56 INSTALL_ENV+=           GEM_PATH=${DESTDIR}${PREFIX}/${GEM_HOME}
57
58 INSTALL_TARGET=         install
59 INSTALL_TARGET+=        --vendor --no-rdoc --no-ri
60 .if ${_USE_DESTDIR} != "no"
61 INSTALL_TARGET+=        --destdir=${DESTDIR:Q}
62 .endif
63
64 # rubygem's setup.rb is not the typical setup.rb -- manually run the
65 # command to install.
66 #
67 do-install:
68         if [ -f ${DESTDIR}${PREFIX}/bin/${RUBYGEM_NAME} ]; then \
69                 ${MV} ${DESTDIR}${PREFIX}/bin/${RUBYGEM_NAME} \
70                         ${DESTDIR}${PREFIX}/bin/${RUBYGEM_NAME}.orig; \
71         fi
72         cd ${WRKSRC} && ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} \
73                 ${RUBY} setup.rb ${INSTALL_TARGET}
74         ${MV} ${DESTDIR}${PREFIX}/bin/${RUBYGEM_NAME} \
75                  ${DESTDIR}${PREFIX}/bin/${RUBYGEM_NAME}.new
76         if [ -f ${DESTDIR}${PREFIX}/bin/${RUBYGEM_NAME}.orig ]; then \
77                 ${MV} ${DESTDIR}${PREFIX}/bin/${RUBYGEM_NAME}.orig \
78                         ${DESTDIR}${PREFIX}/bin/${RUBYGEM_NAME}; \
79         fi
80
81 .include "../../lang/ruby/modules.mk"
82 .include "../../mk/bsd.pkg.mk"