forked from miku/metha
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (28 loc) · 968 Bytes
/
Makefile
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
SHELL = /bin/bash
TARGETS = metha-sync metha-cat metha-id metha-ls metha-files metha-fortune
PKGNAME = metha
all: $(TARGETS)
$(TARGETS): %: cmd/%/main.go
go get ./...
go build -o $@ $<
clean:
rm -f $(TARGETS)
rm -f $(PKGNAME)_*deb
rm -f $(PKGNAME)-*rpm
rm -rf packaging/deb/$(PKGNAME)/usr
imports:
goimports -w .
deb: $(TARGETS)
mkdir -p packaging/deb/$(PKGNAME)/usr/sbin
cp $(TARGETS) packaging/deb/$(PKGNAME)/usr/sbin
mkdir -p packaging/deb/$(PKGNAME)/usr/local/share/man/man1
cp docs/$(PKGNAME).1 packaging/deb/$(PKGNAME)/usr/local/share/man/man1
cd packaging/deb && fakeroot dpkg-deb --build $(PKGNAME) .
mv packaging/deb/$(PKGNAME)_*.deb .
rpm: $(TARGETS)
mkdir -p $(HOME)/rpmbuild/{BUILD,SOURCES,SPECS,RPMS}
cp ./packaging/rpm/$(PKGNAME).spec $(HOME)/rpmbuild/SPECS
cp $(TARGETS) $(HOME)/rpmbuild/BUILD
cp docs/$(PKGNAME).1 $(HOME)/rpmbuild/BUILD
./packaging/rpm/buildrpm.sh $(PKGNAME)
cp $(HOME)/rpmbuild/RPMS/x86_64/$(PKGNAME)*.rpm .