| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
ifneq ($(filter gnu,${CONFIGURE_STYLE}),) |
|---|
| 19 |
REORDER_DEPENDENCIES+= ${TOPDIR}/scripts/automake.dep |
|---|
| 20 |
endif |
|---|
| 21 |
|
|---|
| 22 |
REORDER_DEPENDENCIES?= |
|---|
| 23 |
|
|---|
| 24 |
ifneq ($(strip ${FWRT_PACKAGE_FWWIF}),) |
|---|
| 25 |
ifneq ($(filter fwwif,${INSTALL_STYLE}),) |
|---|
| 26 |
${_IPKGS_COOKIE}: ${TOPDIR}/.cfg/FWRT_PACKAGE_FWWIF |
|---|
| 27 |
endif |
|---|
| 28 |
endif |
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
pre-configure: |
|---|
| 32 |
do-configure: |
|---|
| 33 |
post-configure: |
|---|
| 34 |
${_CONFIGURE_COOKIE}: ${_PATCH_COOKIE} |
|---|
| 35 |
ifneq ($(strip ${REORDER_DEPENDENCIES}),) |
|---|
| 36 |
@sed -e '/^ |
|---|
| 37 |
tsort -r | while read f; do \ |
|---|
| 38 |
cd ${WRKSRC}; \ |
|---|
| 39 |
case $$f in \ |
|---|
| 40 |
/*) \ |
|---|
| 41 |
find . -name "$${f#/}" -print | while read i; do \ |
|---|
| 42 |
echo "Touching $$i"; touch "$$i"; \ |
|---|
| 43 |
done;; \ |
|---|
| 44 |
*) \ |
|---|
| 45 |
if test -e "$$f" ; then \ |
|---|
| 46 |
echo "Touching $$f"; touch "$$f"; \ |
|---|
| 47 |
fi;; \ |
|---|
| 48 |
esac; \ |
|---|
| 49 |
done |
|---|
| 50 |
endif |
|---|
| 51 |
mkdir -p ${WRKBUILD} |
|---|
| 52 |
@${MAKE} pre-configure |
|---|
| 53 |
ifneq ($(filter gnu,${CONFIGURE_STYLE}),) |
|---|
| 54 |
cd ${WRKBUILD}; rm -f config.{cache,status}; \ |
|---|
| 55 |
env ${CONFIGURE_ENV} \ |
|---|
| 56 |
${MBSH} ${WRKSRC}/configure \ |
|---|
| 57 |
--build=${GNU_HOST_NAME} \ |
|---|
| 58 |
--host=${GNU_TARGET_NAME} \ |
|---|
| 59 |
--target=${GNU_TARGET_NAME} \ |
|---|
| 60 |
--program-prefix= \ |
|---|
| 61 |
--program-suffix= \ |
|---|
| 62 |
--prefix=/usr \ |
|---|
| 63 |
--datadir=/usr/share \ |
|---|
| 64 |
--mandir=/usr/share/man \ |
|---|
| 65 |
--libexecdir=/usr/lib \ |
|---|
| 66 |
--localstatedir=/var \ |
|---|
| 67 |
--sysconfdir=/etc \ |
|---|
| 68 |
--disable-nls \ |
|---|
| 69 |
--enable-shared \ |
|---|
| 70 |
--disable-static \ |
|---|
| 71 |
--disable-dependency-tracking \ |
|---|
| 72 |
--disable-libtool-lock \ |
|---|
| 73 |
--disable-debug \ |
|---|
| 74 |
${CONFIGURE_ARGS} |
|---|
| 75 |
else ifneq ($(filter bsd,${CONFIGURE_STYLE}),) |
|---|
| 76 |
cd ${WRKBUILD} && env ${MAKE_ENV} ${BSDMAKE} -f ${MAKE_FILE} \ |
|---|
| 77 |
${MAKE_FLAGS} obj |
|---|
| 78 |
cd ${WRKBUILD} && env ${MAKE_ENV} ${BSDMAKE} -f ${MAKE_FILE} \ |
|---|
| 79 |
${MAKE_FLAGS} depend |
|---|
| 80 |
else ifeq ($(filter-out manual,${CONFIGURE_STYLE}),) |
|---|
| 81 |
env ${CONFIGURE_ENV} ${MAKE} do-configure |
|---|
| 82 |
else |
|---|
| 83 |
@echo "Invalid CONFIGURE_STYLE '${CONFIGURE_STYLE}'" >&2 |
|---|
| 84 |
@exit 1 |
|---|
| 85 |
endif |
|---|
| 86 |
@${MAKE} post-configure |
|---|
| 87 |
touch $@ |
|---|
| 88 |
|
|---|
| 89 |
|
|---|
| 90 |
|
|---|
| 91 |
|
|---|
| 92 |
MAKEJOBS:= |
|---|
| 93 |
ifneq (${FWRT_MAKE_PARALLEL},) |
|---|
| 94 |
ifneq (${PKG_PARALLEL},) |
|---|
| 95 |
MAKEJOBS:= -j${FWRT_MAKE_JOBS} |
|---|
| 96 |
endif |
|---|
| 97 |
endif |
|---|
| 98 |
|
|---|
| 99 |
|
|---|
| 100 |
pre-build: |
|---|
| 101 |
do-build: |
|---|
| 102 |
post-build: |
|---|
| 103 |
${_BUILD_COOKIE}: ${_CONFIGURE_COOKIE} |
|---|
| 104 |
@env ${MAKE_ENV} ${MAKE} pre-build |
|---|
| 105 |
ifneq ($(filter auto,${BUILD_STYLE}),) |
|---|
| 106 |
cd ${WRKBUILD} && env ${MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \ |
|---|
| 107 |
${MAKEJOBS} ${MAKE_FLAGS} ${ALL_TARGET} |
|---|
| 108 |
else ifneq ($(filter bsd,${BUILD_STYLE}),) |
|---|
| 109 |
cd ${WRKBUILD} && env ${MAKE_ENV} ${BSDMAKE} -f ${MAKE_FILE} \ |
|---|
| 110 |
${MAKEJOBS} ${MAKE_FLAGS} ${ALL_TARGET} |
|---|
| 111 |
else ifneq ($(filter manual,${BUILD_STYLE}),) |
|---|
| 112 |
env ${MAKE_ENV} ${MAKE} do-build |
|---|
| 113 |
else ifeq ($(strip ${BUILD_STYLE}),) |
|---|
| 114 |
env ${MAKE_ENV} ${MAKE} do-build |
|---|
| 115 |
else |
|---|
| 116 |
@echo "Invalid BUILD_STYLE '${BUILD_STYLE}'" >&2 |
|---|
| 117 |
@exit 1 |
|---|
| 118 |
endif |
|---|
| 119 |
ifneq ($(strip ${FWRT_PACKAGE_FWWIF}),) |
|---|
| 120 |
ifneq ($(filter fwwif,${BUILD_STYLE}),) |
|---|
| 121 |
mirpax -rw fwwif ${WRKDIR}/ |
|---|
| 122 |
cd ${WRKDIR}/fwwif && env ${MAKE_ENV} ${BSDMAKE} MODULE=${PKG_NAME} \ |
|---|
| 123 |
XARCH=${ARCH} CROSSROOT=${TOPDIR}/cross_${ARCH} ${MAKE_FLAGS} all |
|---|
| 124 |
endif |
|---|
| 125 |
endif |
|---|
| 126 |
@env ${MAKE_ENV} ${MAKE} post-build |
|---|
| 127 |
touch $@ |
|---|
| 128 |
|
|---|
| 129 |
|
|---|
| 130 |
pre-install: |
|---|
| 131 |
do-install: |
|---|
| 132 |
post-install: |
|---|
| 133 |
${_FAKE_COOKIE}: ${_BUILD_COOKIE} |
|---|
| 134 |
-rm -f ${_ALL_CONTROLS} |
|---|
| 135 |
@mkdir -p '${STAGING_PARENT}/pkg' ${WRKINST} '${STAGING_DIR}/scripts' |
|---|
| 136 |
@${MAKE} ${_ALL_CONTROLS} |
|---|
| 137 |
@env ${MAKE_ENV} ${MAKE} pre-install |
|---|
| 138 |
ifneq ($(filter auto,${INSTALL_STYLE}),) |
|---|
| 139 |
cd ${WRKBUILD} && env ${MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \ |
|---|
| 140 |
DESTDIR='${WRKINST}' ${FAKE_FLAGS} ${INSTALL_TARGET} |
|---|
| 141 |
else ifneq ($(filter bsd,${INSTALL_STYLE}),) |
|---|
| 142 |
@mkdir -p ${WRKINST}/{,usr/}{bin,include,lib,sbin,share/man/{cat,man}{1,2,3,3p,4,5,6,7,8,9}} |
|---|
| 143 |
cd ${WRKBUILD} && env ${MAKE_ENV} ${BSDMAKE} -f ${MAKE_FILE} \ |
|---|
| 144 |
DESTDIR='${WRKINST}' ${FAKE_FLAGS} ${INSTALL_TARGET} |
|---|
| 145 |
else ifneq ($(filter manual,${INSTALL_STYLE}),) |
|---|
| 146 |
env ${MAKE_ENV} ${MAKE} do-install |
|---|
| 147 |
else ifeq ($(strip ${INSTALL_STYLE}),) |
|---|
| 148 |
env ${MAKE_ENV} ${MAKE} do-install |
|---|
| 149 |
else |
|---|
| 150 |
@echo "Invalid INSTALL_STYLE '${INSTALL_STYLE}'" >&2 |
|---|
| 151 |
@exit 1 |
|---|
| 152 |
endif |
|---|
| 153 |
ifneq ($(filter confprog,${INSTALL_STYLE}),) |
|---|
| 154 |
for a in ${WRKINST}/usr/{bin/*-config,lib/pkgconfig/*.pc}; do \ |
|---|
| 155 |
[[ -e $$a ]] || continue; \ |
|---|
| 156 |
printf ',g/^prefix=/s,,&${STAGING_DIR},\nwq\n' | ed -s $$a; \ |
|---|
| 157 |
done |
|---|
| 158 |
@: |
|---|
| 159 |
endif |
|---|
| 160 |
ifneq ($(strip ${FWRT_PACKAGE_FWWIF}),) |
|---|
| 161 |
ifneq ($(filter fwwif,${INSTALL_STYLE}),) |
|---|
| 162 |
${INSTALL_DIR} ${FWWIF_IDIR}/{etc,usr/lib}/fwwif |
|---|
| 163 |
[[ ! -e fwwif/app.conf ]] || ${INSTALL_DATA} fwwif/app.conf \ |
|---|
| 164 |
${FWWIF_IDIR}/etc/fwwif/${PKG_NAME}.app |
|---|
| 165 |
${INSTALL_SCRIPT} ${WRKDIR}/fwwif/${PKG_NAME}.so \ |
|---|
| 166 |
${FWWIF_IDIR}/usr/lib/fwwif/ |
|---|
| 167 |
endif |
|---|
| 168 |
endif |
|---|
| 169 |
@env ${MAKE_ENV} ${MAKE} post-install |
|---|
| 170 |
@if test -s '${STAGING_PARENT}/pkg/${PKG_NAME}'; then \ |
|---|
| 171 |
cd '${STAGING_DIR}'; \ |
|---|
| 172 |
while read fn; do \ |
|---|
| 173 |
rm -f "$$fn"; \ |
|---|
| 174 |
done <'${STAGING_PARENT}/pkg/${PKG_NAME}'; \ |
|---|
| 175 |
fi |
|---|
| 176 |
@rm -f '${STAGING_PARENT}/pkg/${PKG_NAME}' |
|---|
| 177 |
@cd ${WRKINST}; \ |
|---|
| 178 |
find lib \( -name lib\*.so\* -o -name lib\*.a \) \ |
|---|
| 179 |
-exec echo 'WARNING: ${PKG_NAME} installs files in /lib -' \ |
|---|
| 180 |
' fix this!' >&2 \; -quit 2>/dev/null; \ |
|---|
| 181 |
find usr ! -type d 2>/dev/null | \ |
|---|
| 182 |
grep -v -e '^usr/share' -e '^usr/man' -e '^usr/info' | \ |
|---|
| 183 |
tee '${STAGING_PARENT}/pkg/${PKG_NAME}' | \ |
|---|
| 184 |
mircpio -apdlmu '${STAGING_DIR}' |
|---|
| 185 |
@cd '${STAGING_DIR}'; grep 'usr/lib/.*\.la$$' \ |
|---|
| 186 |
'${STAGING_PARENT}/pkg/${PKG_NAME}' | while read fn; do \ |
|---|
| 187 |
chmod u+w $$fn; \ |
|---|
| 188 |
printf '%s\nwq\n' '/^libdir='\''*/s |
|---|
| 189 |
ed -s $$fn; \ |
|---|
| 190 |
done; grep 'usr/s*bin/' '${STAGING_PARENT}/pkg/${PKG_NAME}' | \ |
|---|
| 191 |
while read fn; do \ |
|---|
| 192 |
b="$$(dd if="$$fn" bs=2 count=1 2>/dev/null)"; \ |
|---|
| 193 |
[[ $$b = ' |
|---|
| 194 |
cp "$$fn" scripts/; \ |
|---|
| 195 |
echo "scripts/$$(basename "$$fn")" \ |
|---|
| 196 |
>>'${STAGING_PARENT}/pkg/${PKG_NAME}'; \ |
|---|
| 197 |
done |
|---|
| 198 |
ifeq (${FWRT_MANPAGES},y) |
|---|
| 199 |
@mksh ${TOPDIR}/scripts/genhtman.sh '${WRKINST}' '${WRKDIR}' '${PKG_NAME}' |
|---|
| 200 |
endif |
|---|
| 201 |
touch $@ |
|---|
| 202 |
|
|---|
| 203 |
|
|---|
| 204 |
${_IPKGS_COOKIE}: |
|---|
| 205 |
clean=0; \ |
|---|
| 206 |
for f in ${ALL_IPKGS}; do \ |
|---|
| 207 |
[[ -e $$f ]] && clean=1; \ |
|---|
| 208 |
done; \ |
|---|
| 209 |
[[ $$clean = 0 ]] || ${MAKE} clean |
|---|
| 210 |
exec ${MAKE} package |
|---|
| 211 |
|
|---|
| 212 |
package: ${ALL_IPKGS} |
|---|
| 213 |
@cd ${WRKDIR}/fake-${ARCH} || exit 1; \ |
|---|
| 214 |
y=; sp=; for x in ${ALL_IDIRS}; do \ |
|---|
| 215 |
y="$$y$$sp$${x#$(WRKDIR)/fake-${ARCH}/}"; \ |
|---|
| 216 |
sp=' '; \ |
|---|
| 217 |
done; ls=; ln=; x=1; [[ -z $$y ]] || \ |
|---|
| 218 |
md5sum $$(find $$y -type f) | \ |
|---|
| 219 |
while read sum name; do \ |
|---|
| 220 |
inode=$$(ls -i "$$name"); \ |
|---|
| 221 |
echo "$$sum $${inode%% *} $$name"; \ |
|---|
| 222 |
done | sort | while read sum inode name; do \ |
|---|
| 223 |
if [[ $$sum = $$ls ]]; then \ |
|---|
| 224 |
[[ $$li = $$inode ]] && continue; \ |
|---|
| 225 |
case $$x in \ |
|---|
| 226 |
1) echo 'WARNING: duplicate files found in' \ |
|---|
| 227 |
'package "${PKG_NAME}"! Fix them.' >&2; \ |
|---|
| 228 |
echo -n "> $$ln "; \ |
|---|
| 229 |
;; \ |
|---|
| 230 |
2) echo -n "> $$ln "; \ |
|---|
| 231 |
;; \ |
|---|
| 232 |
3) echo -n ' '; \ |
|---|
| 233 |
;; \ |
|---|
| 234 |
esac; \ |
|---|
| 235 |
echo -n "$$name"; \ |
|---|
| 236 |
x=3; \ |
|---|
| 237 |
else \ |
|---|
| 238 |
case $$x in \ |
|---|
| 239 |
3) echo; \ |
|---|
| 240 |
x=2; \ |
|---|
| 241 |
;; \ |
|---|
| 242 |
esac; \ |
|---|
| 243 |
fi; \ |
|---|
| 244 |
ls=$$sum; \ |
|---|
| 245 |
ln=$$name; \ |
|---|
| 246 |
li=$$inode; \ |
|---|
| 247 |
done |
|---|
| 248 |
ifeq (${FWRT_MANPAGES},y) |
|---|
| 249 |
cd ${WRKDIR}/wman; mirpax -rw htman ${BIN_DIR}/ |
|---|
| 250 |
endif |
|---|
| 251 |
touch ${_IPKGS_COOKIE} |
|---|
| 252 |
|
|---|
| 253 |
|
|---|
| 254 |
clean-targets: clean-dev-generic |
|---|
| 255 |
|
|---|
| 256 |
clean-dev-generic: |
|---|
| 257 |
@if test -s '${STAGING_PARENT}/pkg/${PKG_NAME}'; then \ |
|---|
| 258 |
cd '${STAGING_DIR}'; \ |
|---|
| 259 |
while read fn; do \ |
|---|
| 260 |
rm -f "$$fn"; \ |
|---|
| 261 |
done <'${STAGING_PARENT}/pkg/${PKG_NAME}'; \ |
|---|
| 262 |
fi |
|---|
| 263 |
@rm -f '${STAGING_PARENT}/pkg/${PKG_NAME}' |
|---|