forked from NetBSDfr/pkgin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
154 lines (124 loc) · 3.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# This is a BSD-style Makefile for pkgin.
PROG= pkgin
MAN= pkgin.1
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 pkg_install.c preferred.c
# included from libinstall
SRCS+= automatic.c dewey.c fexec.c opattern.c pkgdb.c var.c xwrapper.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
LOCALBASE?= @prefix@
BINDIR?= ${LOCALBASE}/bin
PKG_SYSCONFDIR?= ${LOCALBASE}/etc
VARBASE?= /var
.if !defined(PKGMANDIR)
MANDIR= ${LOCALBASE}/share/man
.endif
# read pkginstall-prefix from configure if any
.if "@PKGTOOLS@"
PKGTOOLS?= @PKGTOOLS@
.endif
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_DBDIR!= pwd
.else
PKGIN_DBDIR= ${VARBASE}/db/pkgin
.endif
WARNS?= 6
# These should all be fixed at some point
COPTS.actions.c+= -Wno-format-nonliteral
COPTS.autoremove.c+= -Wno-format-nonliteral
COPTS.depends.c+= -Wno-format-nonliteral
COPTS.pkg_check.c+= -Wno-format-nonliteral
COPTS.pkgindb.c+= -Wno-format-nonliteral
COPTS.pkglist.c+= -Wno-format-nonliteral
COPTS.selection.c+= -Wno-format-nonliteral
# These are all in external code, leave alone to ease syncing.
COPTS.dewey.c+= -Wno-sign-conversion
COPTS.opattern.c+= -Wno-sign-conversion
COPTS.progressmeter.c+= -Wno-conversion -Wno-sign-compare -Wno-sign-conversion
COPTS.var.c+= -Wno-sign-conversion
CPPFLAGS+= @CPPFLAGS@
CPPFLAGS+= -g
CPPFLAGS+= -DLOCALBASE=\"${LOCALBASE}\" \
-DPKG_SYSCONFDIR=\"${PKG_SYSCONFDIR}\" \
-DPKGIN_DBDIR=\"${PKGIN_DBDIR}\" \
-DPKGTOOLS=\"${PKGTOOLS}\"
CPPFLAGS+= -DHAVE_CONFIG_H
CPPFLAGS+= -D_LARGEFILE_SOURCE -D_LARGE_FILES
CPPFLAGS+= -DCHECK_MACHINE_ARCH=\"${MACHINE_ARCH}\"
CPPFLAGS+= -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
README.md: pkgin.1.ronn
@SED@ -E -e 's/<([^\ \<]+)>/_\1_/g' \
-e 's/<([=0-9].+)/\<\1/g;s/>([=0-9].+)/\>\1/g' \
pkgin.1.ronn >README.md
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
.if !defined(PKGMANDIR) # not installed via pkgsrc
. for _mandir in cat1 html1 man1
${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} -m 755 \
${DESTDIR}${MANDIR}/${_mandir}
. endfor
.endif
install:
.for _conf in repositories.conf preferred.conf
test -f ${DESTDIR}${PKG_SYSCONFDIR}/pkgin/${_conf} || \
${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
${_conf}
${DESTDIR}${PKG_SYSCONFDIR}/pkgin/${_conf}
.endfor
deinstall:
rm -f ${DESTDIR}${BINDIR}/pkgin
.for _mandir in cat1 html1 man1
rm -f ${DESTDIR}${MANDIR}/${_mandir}/pkgin*
.endfor
# makes maintainer's life easier
.if defined(PKGIN_WIP)
WIPHOME=${PKGIN_WIP}
CURDATE!=date +%Y%m%d
WIPREV!=git log --pretty=format:'%H' -n 1
OLDREV!=sed -En 's/GHCOMMIT=[^0-9a-z]+([0-9a-z]+)/\1/p' \
${WIPHOME}/pkgin/Makefile
.endif
bump:
rm -f ${WIPHOME}/pkgin/distinfo \
${WIPHOME}/../distfiles/pkgin-* \
${WIPHOME}/../distfiles/${OLDREV}*
perl -pi -e "s/(GHCOMMIT=[\ \t]+).*/GHCOMMIT=\t\t${WIPREV}/" \
${WIPHOME}/pkgin/Makefile
perl -pi -e "s/pkgin-[0-9\.]+/pkgin-@PACKAGE_VERSION@.${CURDATE}/"\
${WIPHOME}/pkgin/Makefile
cd ${WIPHOME}/pkgin && make makesum
.include <bsd.prog.mk>