blob: a581f1f3066e087ff3e95775fc286c840af9a164 [file] [log] [blame]
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +01001# This PKGBUILD requires root at the package stage. Building works as user, afterwards
Adam Jimerson53bb08b2018-01-22 06:52:35 -05002# to fetch source use fetch-src <release-version> to do a shallow clone from Git.
Adam Jimerson91053182017-01-11 20:22:27 -05003# use makepkg -sdd as root to build
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +02004#
Adam Jimerson53bb08b2018-01-22 06:52:35 -05005pkgname=('freebsd-world' 'freebsd-kernel' 'freebsd-source' 'freebsd-init' 'freebsd-boot')
Amzo64675092015-08-27 21:20:13 +01006if [[ "$CARCH" == "amd64" ]]; then
Wolfgang Bumiller3d240542014-05-10 11:13:40 +02007 pkgname=(${pkgname[@]} 'freebsd-lib32')
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +02008fi
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +01009
Adam Jimerson53bb08b2018-01-22 06:52:35 -050010_freebsdver=11.1-RELEASE
Adam Jimersonb52fcbf2017-01-09 19:44:26 -050011_libarchivever=3.2.2
Wolfgang Bumiller698cc772014-05-10 10:51:51 +020012
Adam Jimerson53bb08b2018-01-22 06:52:35 -050013pkgver=11.1
Adam Jimersona4cfce62018-03-14 17:25:49 -040014pkgrel=5
Adam Jimerson53bb08b2018-01-22 06:52:35 -050015arch=('amd64')
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +020016url="https://www.freebsd.org"
17license=('BSD')
Amzoa6fadbe2014-09-29 16:49:25 +000018options=('!strip' 'emptydirs' '!fbsd10fix' 'staticlibs')
Amzob1a708b2015-11-08 21:31:28 +000019makedepends=('git')
Adam Jimerson53bb08b2018-01-22 06:52:35 -050020#patchdir="${srcdir}/usr/src"
21patchdir="${srcdir}/freebsd"
Adam Jimersonb52fcbf2017-01-09 19:44:26 -050022## The commit should currently come from the stable/11 branch
Adam Jimerson53bb08b2018-01-22 06:52:35 -050023source=("src.txz"
Adam Jimersonb52fcbf2017-01-09 19:44:26 -050024 'PACBSD_i386'
25 'PACBSD_amd64'
Wolfgang Bumiller5cfc2b12014-05-11 16:23:11 +020026 'libcrypto.pc.in'
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +010027 'libarchive.pc'
Wolfgang Bumiller5cfc2b12014-05-11 16:23:11 +020028 'openssl.pc.in'
Adam Jimersonb52fcbf2017-01-09 19:44:26 -050029 'tmpfiles.in')
Adam Jimersona4cfce62018-03-14 17:25:49 -040030sha256sums=('fed0bb60c6e8c2d1753ae87e3c4ae39db566ca9fc0d9034b0f37142fcb4b184d'
Adam Jimersonb52fcbf2017-01-09 19:44:26 -050031 'd55fc2516152088683b997b3817c027f704f51ffe63669b45706cc1bb1a78a5f'
32 'ffb934cb84118fedc2412a101b8d6120e478d8ae0bddc259394e9e166c3a8d97'
33 '588ca995bf3993cb204ae5120000dca959b95ed01241e04add374e0bf9ea95b3'
34 'd7330acf6cde09bfd54cf6590d4e989c5a2abb49e0d3209f2f242af8012384b5'
35 '4a64e9d0e5222c1550324ddbdda3b51747e8f9b1487b148598c795e5d6b764f5'
36 '13db30e5683f1f18cef82c737ea84c47fb163f4ea8efb554d75be99bc0c6e1c7')
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +020037
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +020038prepare() {
Adam Jimerson53bb08b2018-01-22 06:52:35 -050039 cd "${srcdir}/freebsd"
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +020040
Amzo6837b4a2013-11-21 02:18:05 +000041 #Remove the horrible dir string in uname
Adam Jimerson53bb08b2018-01-22 06:52:35 -050042 sed -i '' -e 's/:\${d}//g' "${srcdir}/freebsd/sys/conf/newvers.sh"
Amzo908e7952014-03-10 04:12:04 +000043
44 #Remove debug options from generic
Adam Jimerson53bb08b2018-01-22 06:52:35 -050045 sed -i '' -e '/DEBUG=/d' "${srcdir}/freebsd/sys/amd64/conf/GENERIC"
Wolfgang Bumiller5cfc2b12014-05-11 16:23:11 +020046
47 cd "${srcdir}"
48 msg "Fetching version info for .pc files"
Adam Jimerson53bb08b2018-01-22 06:52:35 -050049 local openssl_version=$(grep -m1 '^VERSION=' freebsd/crypto/openssl/Makefile \
Wolfgang Bumiller5cfc2b12014-05-11 16:23:11 +020050 | sed -e 's/^VERSION=[[:space:]]*//')
51 msg "openssl: ${openssl_version}"
52 sed -e "s|%%VERSION%%|${openssl_version}|g" openssl.pc.in > openssl.pc
53
54 # libcrypto and openssl share their version
55 msg "libcrypto: ${openssl_version}"
56 sed -e "s|%%VERSION%%|${openssl_version}|g" libcrypto.pc.in > libcrypto.pc
57
58 # libarchive only has it in a #define, I wonder if it'll stay that way
59 # in the sources
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +020060}
61
62flags_for_all() {
63 cd "$srcdir"
64
65 export MAKEOBJDIRPREFIX="$srcdir/obj"
66 unset LDFLAGS CXXFLAGS CPPFLAGS CFLAGS M4 LD RANLIB ld
Amzo64675092015-08-27 21:20:13 +010067 if [[ "$CARCH" == "amd64" ]]; then
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +010068 export TARGET=amd64
Adam Jimersonb52fcbf2017-01-09 19:44:26 -050069 export KERNCONF=PACBSD_amd64
Amzob1a708b2015-11-08 21:31:28 +000070 export CFLAGS="-march=x86-64 -mtune=generic -O2"
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +020071 else
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +010072 export TARGET=i386
Adam Jimersonb52fcbf2017-01-09 19:44:26 -050073 export KERNCONF=PACBSD_i386
Amzob1a708b2015-11-08 21:31:28 +000074 export CFLAGS="-march=i686 -mtune=generic -O2"
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +020075 fi
76
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +010077 # building the default parameters here:
78 bsdmakeflags=(
79 KERNCONF="${KERNCONF}"
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +010080 NO_FSCHG=1
81 )
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +020082}
83
84_build() {
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +020085
Adam Jimerson53bb08b2018-01-22 06:52:35 -050086 cd "${srcdir}/freebsd"
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +010087 msg "Linking kernel config"
Adam Jimerson53bb08b2018-01-22 06:52:35 -050088 ln -sf "${srcdir}/$KERNCONF" "${srcdir}/freebsd/sys/${TARGET}/conf/$KERNCONF"
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +020089
Wolfgang Bumillerf113bdf2014-05-10 11:17:30 +020090 msg "Building Kernel toolchain"
91 make WERROR= NO_WERROR= "${bsdmakeflags[@]}" kernel-toolchain || (echo kernel-toolchain failed... && return 1)
92
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +020093 msg "Building Kernel"
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +010094 make WERROR= NO_WERROR= "${bsdmakeflags[@]}" buildkernel || (echo buildkernel failed... && return 1)
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +020095
96 msg "Building world"
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +010097 make WERROR= NO_WERROR= "${bsdmakeflags[@]}" buildworld || (echo buildworld failed... && return 1)
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +020098
99}
100
101_package_freebsd-kernel() {
Wolfgang Bumiller2cfc6832014-04-20 09:32:23 +0200102 pkgdesc="FreeBSD kernel package ${_git_desc}"
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200103 groups=('base')
104 options=('!strip')
105
Adam Jimerson53bb08b2018-01-22 06:52:35 -0500106 cd "${srcdir}/freebsd"
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200107
Adam Jimersona4cfce62018-03-14 17:25:49 -0400108 make -j4 "${bsdmakeflags[@]}" DESTDIR="${pkgdir}" installkernel || (echo installkernel failed... && return 1)
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200109}
110
111_package_freebsd-world() {
Wolfgang Bumiller2cfc6832014-04-20 09:32:23 +0200112 pkgdesc="FreeBSD base package ${_git_desc}"
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200113 groups=('base')
Amzo53e9da42016-01-06 12:29:44 +0000114 depends=('init' 'freebsd-kernel')
Amzocc2cb1a2016-01-05 20:27:40 +0000115 conflicts=(libexecinfo libarchive)
Amzod092c722016-03-24 15:40:28 +0000116 provides=(libc=${_freebsdver} zlib=${_freebsdver} libexecinfo libarchive=${_libarchivever} sh)
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200117
Adam Jimerson53bb08b2018-01-22 06:52:35 -0500118 cd "${srcdir}/freebsd"
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200119
120 msg "Running make installworld distribution..."
Adam Jimersona4cfce62018-03-14 17:25:49 -0400121 make -j4 "${bsdmakeflags[@]}" DESTDIR="$pkgdir" -DWITHOUT_LIB32 installworld distribution
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200122
123 msg "Installed. Cleaning up and configuring..."
124
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200125 #remove rc tools for openrc
Wolfgang Bumiller698cc772014-05-10 10:51:51 +0200126 rm -r ${pkgdir}/etc/rc.d*
Wolfgang Bumillerbf22e2a2014-05-10 13:13:40 +0200127
128 rm ${pkgdir}/etc/{rc,rc.shutdown} \
129 ${pkgdir}/usr/share/man/man8/rc.8.gz
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200130
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200131 #remove rc.conf in defaults provided by FreeBSD-Configs
Wolfgang Bumillerbf22e2a2014-05-10 13:13:40 +0200132 rm "${pkgdir}"/etc/defaults/rc.conf \
133 "${pkgdir}"/etc/rc.subr
Amzo2e1bf3e2014-05-08 05:07:51 +0100134
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200135 #Remove freebsd-update
Wolfgang Bumillerbf22e2a2014-05-10 13:13:40 +0200136 rm "${pkgdir}"/usr/sbin/freebsd-update \
137 "${pkgdir}"/usr/share/man/man1/cpp.1.gz
138
Adam Jimerson53bb08b2018-01-22 06:52:35 -0500139 #Remove files now proveded by FreeBSD-boot
140 mv "${pkgdir}/boot" "${srcdir}/freebsd/" # a bit backwards but should work
141
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200142 #Remove files now provided by FreeBSD-config
Wolfgang Bumillerbf22e2a2014-05-10 13:13:40 +0200143 rm "${pkgdir}"/etc/freebsd-update.conf \
144 "${pkgdir}"/etc/netstart \
145 "${pkgdir}"/etc/devd/asus.conf \
Wolfgang Bumillerbf22e2a2014-05-10 13:13:40 +0200146 "${pkgdir}"/etc/csh.cshrc \
147 "${pkgdir}"/etc/devd.conf \
148 "${pkgdir}"/etc/devfs.conf \
149 "${pkgdir}"/etc/motd \
150 "${pkgdir}"/etc/profile \
151 "${pkgdir}"/etc/sysctl.conf \
152 "${pkgdir}"/etc/devd/uath.conf \
153 "${pkgdir}"/etc/devd/usb.conf
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200154
Adam Jimerson1891ee02017-01-11 20:32:33 -0500155 #FIXME: remove /rescue as this throws of libarchives size calculations.
Amzod13f0ea2016-07-15 16:45:57 +0000156 rm -rf "${pkgdir}/rescue"
Adam Jimersonb52fcbf2017-01-09 19:44:26 -0500157 rm -rf "${pkgdir}/usr/tests"
Amzod13f0ea2016-07-15 16:45:57 +0000158
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200159 #set var/cache to 755
Wolfgang Bumillerbd42f7b2014-05-10 13:27:37 +0200160 chmod -Rv 755 "${pkgdir}"/var/cache
161 # FIXME: /var/db/entropy seems to have changed from 700 to 755
162 # if keeping it 700 doesn't break anything, fix it up to 700 again!
163 chmod -Rv 700 "${pkgdir}"/var/db/entropy
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200164
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200165 cd "$pkgdir"
166
Wolfgang Bumillerbf22e2a2014-05-10 13:13:40 +0200167 backup=('boot/device.hints')
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200168 for f in `find -E etc -type f ! -regex ".*periodic.*|.*mtree.*|.*defaults.*|.*README|.*Makefile"` `find root var -type f`; do
Wolfgang Bumillerbf22e2a2014-05-10 13:13:40 +0200169 backup+=("${f}")
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200170 done
171
Amzo64675092015-08-27 21:20:13 +0100172 if [[ "$CARCH" == "amd64" ]]; then
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +0100173 msg "Fixing up 32/64 bit include files"
174 # Move machine headers to a 64/ directory and create wrappers
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +0100175 mv "$pkgdir"/usr/include/machine "$srcdir"/machine64
Amzo54ddc912015-01-06 07:59:20 +0000176 install -o root -g wheel -dm755 "$pkgdir"/usr/include/machine
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +0100177 mv "$srcdir"/machine64 "$pkgdir"/usr/include/machine/64
178 # Install 32 bit machine headers to /usr/include/machine/32
Adam Jimerson53bb08b2018-01-22 06:52:35 -0500179 cp -R "$srcdir"/freebsd/sys/i386/include "$pkgdir"/usr/include/machine/32
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +0100180 cd "$pkgdir"/usr/include/machine
Amzo54ddc912015-01-06 07:59:20 +0000181 install -o root -g wheel -dm755 pc
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +0100182 for i in 64/pc/*; do
183 b=${i#64/pc/}
184 cat > "pc/$b" <<EOF
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200185#if __x86_64
186# include <machine/64/pc/$b>
187#else
188# include <machine/32/pc/$b>
189#endif
190EOF
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +0100191 done
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200192
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +0100193 for i in 64/*; do
194 b=${i#64/}
195 if [ "$b" = "pc" ]; then continue; fi
196 if [ -e "32/$b" ]; then
197 cat > "$b" <<EOF
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200198#if __x86_64
199# include <machine/64/$b>
200#else
201# include <machine/32/$b>
202#endif
203EOF
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +0100204 else
205 cat > "$b" <<EOF
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200206#if __x86_64
207# include <machine/64/$b>
208#else
209# error "No such 32-bit include: <machine/32/$b>"
210#endif
211EOF
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +0100212 fi
213 done
214 for i in 32/*; do
215 if [ "$b" = "pc" ]; then continue; fi
216 b=${i#32/}
217 if [ ! -e "$b" ]; then
218 cat > "$b" <<EOF
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200219#if __x86_64
220# error "No such 64-bit include: <machine/64/$b>"
221#else
222# include <machine/32/$b>
223#endif
224EOF
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +0100225 fi
226 done
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200227 fi
Amzoe4693882015-05-31 16:23:05 +0000228 install -o root -g wheel -dm755 "${pkgdir}/usr/libdata/ldconfig"
229 echo "/lib" > "${pkgdir}/usr/libdata/ldconfig/lib"
230 echo "/usr/lib" >> "${pkgdir}/usr/libdata/ldconfig/lib"
231 echo "/usr/local/lib" >> "${pkgdir}/usr/libdata/ldconfig/lib"
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200232
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +0100233 #Install libcrypto pc file
Amzoe4693882015-05-31 16:23:05 +0000234 install -o root -g wheel -m655 "${srcdir}/libcrypto.pc" "${pkgdir}/usr/libdata/pkgconfig/"
235 install -o root -g wheel -m655 "${srcdir}/libarchive.pc" "${pkgdir}/usr/libdata/pkgconfig/"
236 install -o root -g wheel -m655 "${srcdir}/openssl.pc" "${pkgdir}/usr/libdata/pkgconfig/"
237
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +0100238 #Setup console log
239 msg "Setting up console.log"
240 touch console.log
Amzo54ddc912015-01-06 07:59:20 +0000241 install -o root -g wheel -m600 console.log ${pkgdir}/var/log/
Amzoa6fadbe2014-09-29 16:49:25 +0000242 mv ${pkgdir}/sbin/reboot ${pkgdir}/sbin/reboot_
Amzo774e6742014-01-03 14:37:03 +0000243
Amzoa6fadbe2014-09-29 16:49:25 +0000244 echo "#!/bin/sh" > ${pkgdir}/sbin/reboot
245 echo "shutdown -r now" >> ${pkgdir}/sbin/reboot
246 chmod +x ${pkgdir}/sbin/reboot
247 mv ${pkgdir}/usr/share/man/man8/reboot.8.gz ${pkgdir}/usr/share/man/man8/reboot_.8.gz
Amzo774e6742014-01-03 14:37:03 +0000248
Amzoefab49b2014-07-10 14:15:43 +0000249
Amzo774e6742014-01-03 14:37:03 +0000250 #Prevent some log warnings
Amzo54ddc912015-01-06 07:59:20 +0000251 install -o root -g wheel -dm755 ${pkgdir}/var/at/jobs/
252 install -o root -g wheel -dm755 ${pkgdir}/var/db/entropy
Amzo19c79c92014-07-06 16:24:03 +0000253
Amzofcc9eaf2016-03-26 00:29:42 +0000254 rm -rf ${pkgdir}/usr/lib32
Amzode9425c2016-04-12 11:16:04 +0000255
256 # set default pager to less
257 sed -i '' -e 's|PAGER=more|PAGER=less|g' "${pkgdir}/root/.profile" "${pkgdir}/usr/share/skel/dot.profile"
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200258}
259
Adam Jimerson53bb08b2018-01-22 06:52:35 -0500260_package_freebsd-boot() {
261 pkgdesc="FreeBSD boot files from"
262 groups=('base')
263 options=('!strip')
264
265 cd "${srcdir}/freebsd"
266
267 mkdir -p "${pkgdir}/boot"
268 cp -r "${srcdir}/freebsd/boot" "${pkgdir}/"
269 #Remove files now provided by FreeBSD-config
270 rm "${pkgdir}"/boot/beastie.4th \
271 "${pkgdir}"/boot/brand.4th
272}
273
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200274_package_freebsd-source() {
Wolfgang Bumiller2cfc6832014-04-20 09:32:23 +0200275 pkgdesc="FreeBSD source matching FreeBSD kernel ${_git_desc}"
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200276 options=('!strip')
277 arch=('any')
Adam Jimerson53bb08b2018-01-22 06:52:35 -0500278 cd "${srcdir}/freebsd"
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200279 mkdir -p "${pkgdir}/usr/src"
Adam Jimerson53bb08b2018-01-22 06:52:35 -0500280 cp -r "${srcdir}/freebsd"/* "${pkgdir}/usr/src/"
Wolfgang Bumillerbf22e2a2014-05-10 13:13:40 +0200281 # The only place where -f is okay - the above doesn't usually include
282 # dot-files, but w/e...
283 rm -rf "${pkgdir}"/usr/src/.git
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200284}
285
Amzo64675092015-08-27 21:20:13 +0100286if [[ "$CARCH" == "amd64" ]]; then
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200287_package_freebsd-lib32() {
Wolfgang Bumiller2cfc6832014-04-20 09:32:23 +0200288 pkgdesc="FreeBSD lib32 libraries ${_git_desc}"
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +0100289 provides=("lib32-libc=${_freebsdver}")
Amzoa6fadbe2014-09-29 16:49:25 +0000290 options=('!strip' 'staticlibs')
Amzofa44e322015-07-14 19:37:50 +0100291 arch=('amd64')
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +0100292 install=lib32.install
Amzo64675092015-08-27 21:20:13 +0100293 conflicts=(lib32-libexecinfo lib32-libarchive)
294 provides=(lib32-libc=${_freebsdver} lib32-zlib=${_freebsdver} lib32-libexecinfo lib32-openssl lib32-libarchive=${_libarchivever})
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200295
Adam Jimerson53bb08b2018-01-22 06:52:35 -0500296 cd "${srcdir}/freebsd"
Amzoe4693882015-05-31 16:23:05 +0000297 install -o root -g wheel -dm755 "${pkgdir}"/usr/{lib32,libexec,bin}
Amzod13f0ea2016-07-15 16:45:57 +0000298 install -o root -g wheel -dm755 "${pkgdir}"/usr/lib32/{i18n,private,dtrace}
Amzoe4693882015-05-31 16:23:05 +0000299 install -o root -g wheel -dm755 "${pkgdir}"/{lib,libexec}/
300 install -o root -g wheel -dm755 "${pkgdir}"/usr/libdata/pkgconfig
Adam Jimersona4cfce62018-03-14 17:25:49 -0400301 make -j4 "${bsdmakeflags[@]}" DESTDIR="$pkgdir" install32
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200302
Amzoe4693882015-05-31 16:23:05 +0000303 rm -r "${pkgdir}/usr/libdata/pkgconfig"
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200304}
305fi
306
307_package_freebsd-init() {
Wolfgang Bumiller2cfc6832014-04-20 09:32:23 +0200308 pkgdesc="FreeBSD init scripts ${_git_desc}"
Amzoacf9a812015-06-29 13:58:11 +0000309 depends=('tmpfiles')
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +0100310 provides=('init')
311 conflicts=('openrc')
312 options=('!strip')
Amzofa44e322015-07-14 19:37:50 +0100313 arch=('amd64')
Wolfgang Bumiller132f0042014-04-20 09:37:47 +0200314 backup=("etc/rc.conf")
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200315
Adam Jimerson53bb08b2018-01-22 06:52:35 -0500316 cd "${srcdir}/freebsd"
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +0100317 #remove rc tools for openrc
Amzo54ddc912015-01-06 07:59:20 +0000318 install -o root -g wheel -dm755 ${pkgdir}/etc/
Adam Jimerson53bb08b2018-01-22 06:52:35 -0500319 cp -R "${srcdir}/freebsd/etc"/rc* ${pkgdir}/etc/
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200320
Amzoacf9a812015-06-29 13:58:11 +0000321 install -m755 ${srcdir}/tmpfiles.in ${pkgdir}/etc/rc.d/tmpfiles
322
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200323 #Files kept in world as needed by openrc also
Wolfgang Bumiller698cc772014-05-10 10:51:51 +0200324 rm "${pkgdir}"/etc/rc.{bsdextended,firewall,initdiskless,resume,sendmail,suspend}
Amzob4a8e2d2014-03-09 13:52:29 +0000325
Amzoa7d40df2014-05-01 22:55:20 +0100326}
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200327
328build() {
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +0100329 flags_for_all
330 _build
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200331}
332for _p in ${pkgname[@]}; do
Wolfgang Bumillere9d1cfd2013-11-16 11:34:08 +0100333 eval "package_${_p}() {
334 flags_for_all
335 _package_${_p}
336 }"
Wolfgang Bumiller1fca4942013-10-21 11:32:14 +0200337done