summaryrefslogtreecommitdiff
path: root/debian/Makefile
blob: f13e1244fa693574fa1e473db7919a837e3e795e (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# GITVERSION=$(shell git rev-parse FETCH_HEAD)
GUIVERSION=$(shell cd ../../../widget && git describe --tags $(git rev-list --tags --max-count=1) | sed 's/^v//')
TOOLKITVERSION=$(shell git describe --tags $(git rev-list --tags --max-count=1) | sed 's/^v//')

VERSION=${TOOLKITVERSION}

BASENAME=go-gui-toolkits

all: help deb

help:
	@echo
	@echo "make deb     # attempt to build the .deb package using dpkg"
	@echo "make rpm     # attempt to build a .rpm package"
	@echo

deb: clean extract DEBIAN build

clean:
	rm -rf ../files
	rm -f ../*.deb
	rm -f ../*.tar.xz data.tar.xz
	rm -rf DEBIAN

extract:
	mkdir -p ../files/usr/lib/go-gui/${VERSION}
	cp  ../../*.so ../files/usr/lib/go-gui/${VERSION}/
	cp  ../README.md ../files/usr/lib/go-gui/${VERSION}/
	cd  ../files/usr/lib/go-gui/ && ln -s ${VERSION}/ latest

# makes the DEBIAN/ directory
DEBIAN:
	mkdir -p DEBIAN

	# make the md5sum file
	cd ../files/ && find -type f -exec md5sum '{}' \; |sort -k2 >../md5sums
	mv ../md5sums DEBIAN/

	# make the control there
	mkdir -p DEBIAN
	cp control DEBIAN/
	echo Version: ${VERSION} >>DEBIAN/control

	chmod +x DEBIAN

	cp postinst DEBIAN
	# echo cd /usr/lib/go-gui/ >>DEBIAN/postinst
	# echo ln -sf ${GUIVERSION}/${TOOLKITVERSION} latest >>DEBIAN/postinst

build:
	mv DEBIAN ../files/
	-mkdir ~/incoming/
	cd .. && dpkg-deb --build files ~/incoming/${BASENAME}_${VERSION}_amd64.deb
	@echo
	@echo '#######################'
	cd .. && dpkg-deb --info ~/incoming/${BASENAME}_${VERSION}_amd64.deb
	cd .. && dpkg-deb -c ~/incoming/${BASENAME}_${VERSION}_amd64.deb
	@echo '#######################'
	@echo