aboutsummaryrefslogtreecommitdiffstats
path: root/archivers/rpm4/Makefile
blob: cc46fcf981f2789f41e1b06d6c0276713c8b9ba7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Created by: Greg Lewis <glewis@FreeBSD.org>
# $FreeBSD$

PORTNAME=   rpm
PORTVERSION=    4.11.0.1
CATEGORIES= archivers
MASTER_SITES=   http://rpm.org/releases/rpm-${PORTVERSION:R:R}.x/ \
        ftp://ftp.mirrorservice.org/sites/ftp.rpm.org/pub/rpm/dist/rpm-${PORTVERSION:E}.x/

MAINTAINER= johans@FreeBSD.org
COMMENT=    The RPM Package Manager

LIB_DEPENDS=    popt:${PORTSDIR}/devel/popt \
        nss3:${PORTSDIR}/security/nss
BUILD_DEPENDS=  ${LOCALBASE}/bin/gsed:${PORTSDIR}/textproc/gsed

OPTIONS_DEFINE= PYTHON
OPTIONS_DEFAULT=PYTHON

USE_AUTOTOOLS=  libtool
USE_BZIP2=  yes
USE_GMAKE=  yes
USE_LUA=    5.1+
USE_BDB=    46+
INVALID_BDB_VER=51
GNU_CONFIGURE=  yes
USE_LDCONFIG=   yes
LATEST_LINK=    rpm4
CONFLICTS_INSTALL=  rpm-[35].*

CPPFLAGS+=  -I${LOCALBASE}/include \
        -I${LOCALBASE}/include/nspr -I${LOCALBASE}/include/nss/nss \
        -I${BDB_INCLUDE_DIR} -I${LUA_INCDIR}
LDFLAGS+=   -L${LOCALBASE}/lib -L${LOCALBASE}/lib/nss \
        -L${BDB_LIB_DIR} -L${LUA_LIBDIR}
CONFIGURE_ARGS+=--with-external-db \
        --without-db \
        --with-popt-prefix="${LOCALBASE}" \
        --sysconfdir=${PREFIX}/etc \
        --localstatedir=/var \
        --without-javaglue \
        LUA_CFLAGS=-I${LUA_INCDIR} \
        LUA_LIBS="-L${LUA_LIBDIR} -llua-${LUA_VER} -lm"
PLIST_SUB+= VERSION=${PORTVERSION}

.include <bsd.port.options.mk>

.if ${OSVERSION} < 800505 || (${OSVERSION} >= 900000 && ${OSVERSION} < 900012)
LIB_DEPENDS+=   lzma:${PORTSDIR}/archivers/xz
.endif

.if ${PORT_OPTIONS:MPYTHON}
CONFIGURE_ARGS+=--enable-python
USE_PYTHON= 2.6+
PLIST_SUB+= PYTHON=""
CPPFLAGS+=  -I${PYTHON_INCLUDEDIR}
LDFLAGS+=   -L${PYTHON_LIBDIR}
.else
CONFIGURE_ARGS+=--disable-python
PLIST_SUB+= PYTHON="@comment "
.endif

.if ${PORT_OPTIONS:MNLS}
USE_GETTEXT=    yes
USE_ICONV=  yes
PLIST_SUB+= NLS=""
.else
CONFIGURE_ARGS+=--disable-nls
PLIST_SUB+= NLS="@comment "
.endif

MANLANG=    "" ja fr pl ru ko sk
MAN1_EN=    gendiff.1
MAN8_EN=    rpm.8 rpm2cpio.8 rpmbuild.8 rpmdeps.8 rpmgraph.8 \
        rpmdb.8 rpmkeys.8 rpmsign.8 rpmspec.8
MAN8_JA=    rpm.8 rpm2cpio.8 rpmbuild.8 rpmgraph.8
MAN8_FR=    rpm.8
MAN8_PL=    rpm.8 rpm2cpio.8 rpmbuild.8 rpmdeps.8 rpmgraph.8
MAN8_RU=    rpm.8 rpm2cpio.8
MAN8_KO=    rpm.8 rpm2cpio.8
MAN8_SK=    rpm.8

.if !defined(NOPORTDOCS)
PORTDOCS=   *
.endif

.include <bsd.port.pre.mk>

.if ${OSVERSION} < 800502
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-rpmio_rpmsq.c
.endif

.if ${OSVERSION} < 800505 || (${OSVERSION} >= 900000 && ${OSVERSION} < 900012)
LIB_DEPENDS+=   lzma:${PORTSDIR}/archivers/xz
.endif

post-patch:
    ${REINPLACE_CMD} -e '/^pkgconfigdir/s:/:data/:' \
        -e 's:\.\./\.\./bin/::' ${WRKSRC}/Makefile.in
    ${REINPLACE_CMD} -e 's/(hpux)/& || defined(__FreeBSD__)/' \
        ${WRKSRC}/misc/fts.?
    ${REINPLACE_CMD} -e 's/ __GLIBC__.*/& || defined(__FreeBSD__)/' \
        ${WRKSRC}/system.h

post-install:
.if !defined(NOPORTDOCS)
    # Install documentation
    ${MKDIR} ${DOCSDIR}/librpm/html
    cd ${WRKSRC}/doc/librpm/html && ${FIND} . \
        | ${CPIO} -pdmu -R ${SHAREOWN}:${SHAREGRP} \
            ${DOCSDIR}/librpm/html/
.endif
    # Run package installation script
    ${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGDIR}/pkg-install ${PKGNAME} POST-INSTALL

.include <bsd.port.post.mk>