summaryrefslogtreecommitdiffstats
path: root/build
blob: b8a68e0d791b9381d23fb751cbad32ad37b74557 (plain)
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
#!/usr/bin/make -f

include ../source.mk

version = $$(printf '%s\n' '$(OPK_SOURCE_VERSION_UPSTREAM)' | \
	sed 's/^.*+git\(....\)\(..\)\(..\)\.\([0-9a-f]*\).*$$/\4 (\1-\2-\3)/') \
	for ProteanOS

nop:

build:
	(cd src && cmake \
		-D CMAKE_VERBOSE_MAKEFILE:BOOL=ON \
		-D CMAKE_INSTALL_PREFIX:PATH=/usr \
		-D LOCK_FILE:STRING=/var/lib/opkg/lock \
		-D STATE_DIR_PREFIX:STRING=/var/lib \
		-D STATIC_UBOX:BOOL=ON \
		-D BUILD_TESTS:BOOL=OFF \
		-D REQUIRE_UPGRADE_ARGS:BOOL=OFF \
		-D VERSION:STRING="$(version)" \
		.)
	oh-autobuild
	touch $@

install: build
	oh-autoinstall
	install -m 0755 ../opkg      dest/usr/bin/opkg
	install -m 0755 ../opkg-cert dest/usr/bin/opkg-cert
	install -m 0755 -d dest/usr/sbin/
	ln -sf /usr/bin/opkg-cert dest/usr/sbin/opkg-key
	@# opkg-lede's CMake build system doesn't install this...
	sed '1s|^.*$$|#!/var/lib/opkg/bin/sh|; s|@opkglibdir@|/var/lib|g' \
		src/utils/update-alternatives.in \
		>dest/usr/bin/update-alternatives
	oh-fixperms
	oh-strip -k
	oh-installfiles
	oh-shlibdeps