forked from librsync/librsync
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.pkgsrc
150 lines (126 loc) · 5 KB
/
Makefile.pkgsrc
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
# -*- makefile-bsdmake -*-
# $NetBSD$
# N.B.: although this version of LIBRSYNC is diverging from the original, it
# does not yet have any API (or, so far as is known, ABI) differences, thus is
# still "2.0.2"
DISTNAME= librsync-2.0.2
PKGNAME= librsync-2.0.2
PKGREVISION= 2
CATEGORIES= net sysutils
# for use of ${FILESDIR} (as per "make setup-pkgsrc-filesdir" below):
DISTFILES= # empty
#
# else (and remove do-extract):
#MASTER_SITES= ${MASTER_SITE_GITHUB:=robohack/}
#GITHUB_TAG= release-${PKGVERSION_NOREV}
OWNER= woods@planix.ca
HOMEPAGE= https://librsync.github.io/
COMMENT= rsync-like rolling checksum library
LICENSE= gnu-lgpl-v2.1
USE_LANGUAGES= c
USE_BSD_MAKEFILE= yes
BSD_MAKE_BUILD_DIR= ${WRKDIR}/pkgbuild
MAKE_ENV+= MAKEOBJDIRPREFIX=${BSD_MAKE_BUILD_DIR}
#USE_FEATURES+= err warn snprintf asprintf
# xxx this use of ${VAR:!cmd!} is quite ugly to have to do, but because it is
# evaluated lazily it works to find the canonical form of ${WRKSRC} as a
# sub-directory of $MAKEOBJDIRPREFIX to match what the package makefile sees in
# its ${.CURDIR}.
#
# XXX Normally ${WRKSRC} would be a canonical pathname, but it may not be if
# ${WRKOBJDIR} is set, but not to a canonical path.
#
# XXX the appearance of the first word "WRKSRC" in the value below is actually
# unnecessary for make(1), but the makefile parser in pkglint cannot handle it
# being missing! In other news the new pkglint(1) is both kinda stupid and
# overly pedantic.
#
CANONICAL_WRKSRC= ${WRKSRC:!cd ${WRKSRC} && ${PWD_CMD}!}
PKGCONFIG_OVERRIDE= ${BSD_MAKE_BUILD_DIR}/${CANONICAL_WRKSRC}/src/${PKGBASE}.pc
PKGCONFIG_OVERRIDE_STAGE= post-build
AUTO_MKDIRS= yes
# totally automatic PLIST generation -- probably preferable?
#
#GENERATE_PLIST= cd ${DESTDIR}${PREFIX}; \
# ${FIND} * \( -type f -or -type l \) | ${SORT};
#
GENERATE_PLIST+= cd ${DESTDIR}${PREFIX} && \
${FIND} share/doc/${PKGBASE}/html \( -type f -or -type l \) | ${SORT};
.include "../../mk/bsd.prefs.mk"
PLIST_SUBST+= PREFIX=${PREFIX:Q}
# N.B.: the following depend on PKGMAKECONF=/etc/mk.conf or the moral equivalent
# xxx they are also not needed if pkgsrc is properly patched to do this itself!
PLIST_VARS+= mkdebug
.if ${MKDEBUG:Uno:tl} != "no" && !defined(NODEBUG)
PLIST.mkdebug= yes
INSTALLATION_DIRS+= libdata/debug/${PREFIX}/bin
INSTALLATION_DIRS+= libdata/debug/${PREFIX}/libexec
INSTALLATION_DIRS+= libdata/debug/${PREFIX}/sbin
.endif
PLIST_VARS+= mkdebuglib
.if ${MKDEBUGLIB:Uno:tl} != "no"
PLIST.mkdebuglib= yes
INSTALLATION_DIRS+= libdata/debug/${PREFIX}/lib
.endif
PLIST_VARS+= mklint
.if ${MKLINT:Uno:tl} != "no"
PLIST.mklint= yes
.endif
PLIST_VARS+= mkpic
.if ${MKPIC:Uno:tl} != "no"
PLIST.mkpic= yes
.endif
PLIST_VARS+= mkprofile
.if ${MKPROFILE:Uno:tl} != "no"
PLIST.mkprofile= yes
.endif
# xxx only for setup-pkgsrc-filesdir
do-extract:
${MKDIR} ${WRKSRC}
${CP} -Rp ${FILESDIR}/* ${WRKSRC}/
${RM} -rf ${WRKSRC}/CVS
do-configure:
${MKDIR} ${BSD_MAKE_BUILD_DIR}
# n.b.: this package does not need this step -- it does it itself
#pre-build:
# cd ${WRKSRC} && ${BUILD_MAKE_CMD} obj
# how to get from there to here....
#
# git status
# # commit anything outstanding...
# mkdir build
# make -j 8 MAKEOBJDIRPREFIX=$(pwd -P)/build all regress
# make -j 8 MAKEOBJDIRPREFIX=$(pwd -P)/build DESTDIR=$(pwd -P)/dist install
# # check dist/* is correct... (bins, lib names, includes, .pc file, etc.)
# rm -rf build dist
# make distclean
# # update DISTNAME above and LIB_* in Makefile.project...
# git add Makefile.project Makefile.pkgsrc
# git commit -m 'Makefile.project, Makefile.pkgsrc: ready for release: ${PKGVERSION_NOREV}'
# # write release notes in doc/release-${PKGVERSION_NOREV}.md
# git tag -a -s -F doc/release-${PKGVERSION_NOREV}.md release-${PKGVERSION_NOREV}
# gh release create release-${PKGVERSION_NOREV} -t "Version ${PKGVERSION_NOREV}" --verify-tag --notes-from-tag
#
# Now go to where your ${REPODIR} (or where you have cloned
# https://github.com/robohack/pkgsrc to), and 'make setup-pkgsrc':
#
#REPODIR?= . # /work/woods/f-librsync
REPODIR ?= /work/woods/f-librsync
PKGDIR?= /usr/pkgsrc/net/librsync
setup-pkgsrc:
cd ${REPODIR} && pax -rw -v -s '|.pkgsrc$||' *.pkgsrc ${PKGDIR}
cd ${PKGDIR} && make fetch
cd ${PKGDIR} && make makesum
setup-pkgsrc-filesdir:
find ${FILESDIR} -type d \( -name CVS -or -name .git -or -name .svn \) -prune -or -type f ! -name '.*ignore' -print0 | xargs -0 rm
cd ${REPODIR} && find . \( -type d \( -name debian -or -name CVS -or -name .git -or -name .svn -or -name build -or -name 'build-*' -or -name 'd[ei]st' -or -name 'd[ei]st-*' \) -prune \) -or -type f ! -name '.#*' ! -name '#*#' ! -name '*~' ! -name '.*ignore' ! -name '[Tt][Aa][Gg][Ss]' -print | pax -rw ${FILESDIR}
mv ${FILESDIR}/DESCR.pkgsrc ${PKGDIR}/DESCR
mv ${FILESDIR}/Makefile.pkgsrc ${PKGDIR}/Makefile
mv ${FILESDIR}/PLIST.pkgsrc ${PKGDIR}/PLIST
mv ${FILESDIR}/buildlink3.mk.pkgsrc ${PKGDIR}/buildlink3.mk
make fetch
make makesum
.include "../../archivers/bzip2/buildlink3.mk"
.include "../../devel/popt/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"