forked from NetBSDfr/pkgin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
124 lines (95 loc) · 2.91 KB
/
Makefile.in
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
117
118
119
120
121
122
123
124
# $Id: Makefile.in,v 1.20 2012/06/13 13:50:16 imilh Exp $
PROG= pkgin
VERSION= @PACKAGE_VERSION@
SRCS= main.c summary.c tools.c pkgindb.c depends.c actions.c \
pkglist.c download.c order.c impact.c autoremove.c fsops.c \
pkgindb_queries.c pkg_str.c sqlite_callbacks.c selection.c \
pkg_check.c pkg_infos.c
# included from libinstall
SRCS+= automatic.c decompress.c dewey.c fexec.c global.c \
opattern.c pkgdb.c var.c
# included from openssh
SRCS+= progressmeter.c
SRCS+= @SRCS@
DPSRCS= pkgindb_create.h
CC= @CC@
INSTALL= @INSTALL@
OPSYS!= uname
OS_VER!= uname -r
OS_ARCH!= uname -p
# satisfy mk.conf
BSD_PKG_MK= 1
.for MK_CONF in /etc/mk.conf @prefix@/etc/mk.conf /etc/pkgsrc.conf
. if exists(${MK_CONF})
. include "${MK_CONF}"
. endif
.endfor
.if ${OPSYS} == "Minix"
PKGTOOLS?= ${PKG_TOOLS_BIN}
CPPFLAGS+= -D_NETBSD_SOURCE -D_MINIX
.endif
LOCALBASE?= @prefix@
BINDIR?= ${LOCALBASE}/bin
PKG_SYSCONFDIR?= ${LOCALBASE}/etc
VARBASE?= /var
PKG_DBDIR?= ${VARBASE}/db/pkg
PKGTOOLS?= ${LOCALBASE}/sbin
PKGIN_VERSION= "${VERSION} for ${OPSYS}-${OS_VER} ${OS_ARCH}"
CPPFLAGS+= -DPKGIN_VERSION=\"${PKGIN_VERSION}\"
.include <bsd.own.mk>
.PATH: external
.if defined(DEBUG)
CPPFLAGS+= -DDEBUG
PKGIN_DB!= pwd
.else
PKGIN_DB= ${VARBASE}/db/pkgin
.endif
.if ${OPSYS} == "NetBSD"
WARNS= 2
CPPFLAGS+= -DNETBSD
.endif
CPPFLAGS+= @CPPFLAGS@
CPPFLAGS+= -g
CPPFLAGS+= -DLOCALBASE=\"${LOCALBASE}\" \
-DPKG_SYSCONFDIR=\"${PKG_SYSCONFDIR}\" \
-DPKG_DBDIR="\"${PKG_DBDIR}\"" \
-DDEF_LOG_DIR="\"${PKG_DBDIR}\"" \
-DPKGIN_DB=\"${PKGIN_DB}\" \
-DPKGTOOLS=\"${PKGTOOLS}\"
CPPFLAGS+= -DHAVE_CONFIG_H
CPPFLAGS+= -D_LARGEFILE_SOURCE -D_LARGE_FILES
CPPFLAGS+= -DCHECK_MACHINE_ARCH=\"${MACHINE_ARCH}\"
CPPFLAGS+= -Iexternal -I. -I${LOCALBASE}/include
LDFLAGS+= @LDFLAGS@
LDADD+= -L${LOCALBASE}/lib @RPATH@,${LOCALBASE}/lib \
-lbz2 -lz -larchive @LIBS@
LDADD+= -lsqlite3
CLEANFILES+= ${DPSRCS}
pkgindb_create.h:
@SEDCMD=@SED@ ./mkpkgindb.sh > pkgindb_create.h
afterinstall: configinstall
beforeinstall:
${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} -m 755 ${DESTDIR}${BINDIR}
${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} -m 755 \
${DESTDIR}${PKG_SYSCONFDIR}/pkgin
install:
test -f ${DESTDIR}${PKG_SYSCONFDIR}/pkgin/repositories.conf || \
${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
repositories.conf \
${DESTDIR}${PKG_SYSCONFDIR}/pkgin/repositories.conf
# makes maintainer's life easier
WIPHOME=/home/imil/netbsd-cvs/pkgsrc/wip
CURDATE!=date +%Y%m%d
WIPREV!=git log --pretty=format:'%H' -n 1
OLDREV!=sed -En 's/VERSION=[^0-9a-z]+([0-9a-z]+)/\1/p' \
${WIPHOME}/pkgin/Makefile
bump:
rm -f ${WIPHOME}/pkgin/distinfo \
${WIPHOME}/../distfiles/pkgin-* \
${WIPHOME}/../distfiles/${OLDREV}*
perl -pi -e "s/(VERSION=[\ \t]+).*/VERSION=\t\t${WIPREV}/" \
${WIPHOME}/pkgin/Makefile
perl -pi -e "s/pkgin-[0-9]+/pkgin-${CURDATE}/" \
${WIPHOME}/pkgin/Makefile
cd ${WIPHOME}/pkgin && make makesum
.include <bsd.prog.mk>