This repository has been archived by the owner on Aug 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (43 loc) · 1.49 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
PACKAGE = libmadx-dev
RELEASES = https://github.com/MethodicalAcceleratorDesign/MAD-X/archive
# auto-detect version from debian/changelog:
CODENAME = $(shell head -n1 debian/changelog | sed -n 's/.*([0-9a-zA-Z.+~-].*) \([a-z]*\); .*/\1/p')
VERSION = $(shell head -n1 debian/changelog | sed -n 's/.*(\([0-9a-zA-Z.+~-]*\)-[0-9a-zA-Z.+~].*) .*/\1/p')
REVISION = $(shell head -n1 debian/changelog | sed -n 's/.*([0-9a-zA-Z.+~-]*-\([0-9a-zA-Z.+~].*\)) .*/\1/p')
# upstream version to download:
COMMIT = $(VERSION)
DOWNLOAD = build/$(COMMIT).tar.gz
EXTRACT = MAD-X-$(COMMIT)
UPSTREAM = $(RELEASES)/$(COMMIT).tar.gz
# resulting package files:
TEMP = build/$(CODENAME)
TARBALL = $(TEMP)/$(PACKAGE)_$(VERSION).orig.tar.gz
UPLOAD = $(TEMP)/$(PACKAGE)_$(VERSION)-$(REVISION)_source.changes
BUILDDIR = $(TEMP)/$(PACKAGE)-$(VERSION)
PPA = https://launchpad.net/~coldfix/+archive/ubuntu/madx
all: prepare makepkg
# download + extract the MAD-X source code:
$(DOWNLOAD):
mkdir -p build
wget --no-verbose $(UPSTREAM) -O $(DOWNLOAD)
$(TARBALL): $(DOWNLOAD)
mkdir -p $(TEMP)
cp -r $(DOWNLOAD) $(TARBALL)
$(BUILDDIR): $(TARBALL)
tar -xzf $(TARBALL)
mv $(EXTRACT) $(BUILDDIR)
download: $(DOWNLOAD)
prepare: $(TARBALL) $(BUILDDIR)
cp -r debian $(BUILDDIR)
makepkg:
cd $(BUILDDIR) && debuild -S
deb: clean prepare
cd $(BUILDDIR) && debuild
install:
dpkg -i $(TEMP)/*.deb
upload:
dput ppa:coldfix/madx $(UPLOAD)
clean:
rm -rf $(BUILDDIR)
redownload:
wget $(PPA)/+files/libmadx-dev_$(VERSION).orig.tar.gz