summaryrefslogtreecommitdiffstats
path: root/build
blob: 84de89014108d2d378918eaa75ae7b48187799b2 (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
#!/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)/')

nop:

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

install: build
	oh-autoinstall
	mv dest/usr/bin/opkg-cl dest/usr/bin/opkg-lede
	@# opkg-lede's CMake build system doesn't install these...
	cp ../opkg-key dest/usr/bin/opkg-key-lede
	sed 's|@opkglibdir@|/var/lib|g' src/utils/update-alternatives.in \
		>dest/usr/bin/update-alternatives-lede
	oh-fixperms
	oh-strip
	oh-installfiles
	oh-shlibdeps