Debian Codegraph @

debian/rules

raw symbols SCIP
1 #!/usr/bin/make -f
2
3 SVNREPO := https://josm.openstreetmap.de/svn/trunk
4 SVNI18NREPO := https://josm.openstreetmap.de/osmsvn/applications/editors/josm/i18n
5
6 DATE := $(shell date +%Y%m%d)
7 ifdef SVNREV
8 VERSION := 0.0.svn${SVNREV}
9 else
10 VERSION := 0.0.0.${DATE}
11 endif
12 DESTDIR := ../tarballs/josm-${VERSION}
13 DESTTGZ := ../tarballs/josm_${VERSION}+dfsg.orig.tar.gz
14
15 include /usr/share/dpkg/pkg-info.mk
16
17 DEB_UPSTREAM_VERSION := $(shell echo $(DEB_VERSION) | cut -d- -f1)
18
19 %:
20 dh $@
21
22 override_dh_auto_build:
23 # Move translation causing build failure out of the way
24 mv i18n/po/[email protected] .
25
26 dh_auto_build -- -v -d -Ddebian.version=${DEB_VERSION} dist
27
28 mv [email protected] i18n/po/
29
30 execute_after_dh_auto_install:
31 install -m 644 $(CURDIR)/dist/josm-custom.jar $(CURDIR)/debian/josm/usr/share/josm/josm-${DEB_UPSTREAM_VERSION}.jar
32 dh_link usr/share/josm/josm-${DEB_UPSTREAM_VERSION}.jar usr/share/josm/josm.jar
33
34 install -m 755 $(CURDIR)/native/linux/tested/usr/bin/josm $(CURDIR)/debian/josm/usr/bin/josm
35
36 install -d $(CURDIR)/debian/josm/etc/default
37 install -m 644 $(CURDIR)/native/linux/tested/etc/default/josm $(CURDIR)/debian/josm/etc/default/josm
38
39 for size in 512x512 256x256 192x192 128x128 96x96 80x80 72x72 64x64 48x48 42x42 40x40 36x36 32x32 24x24 22x22 16x16 8x8; do \
40 install -d $(CURDIR)/debian/josm/usr/share/icons/hicolor/$${size}/apps ; \
41 install -m 644 $(CURDIR)/native/linux/tested/usr/share/icons/hicolor/$${size}/apps/org.openstreetmap.josm.png $(CURDIR)/debian/josm/usr/share/icons/hicolor/$${size}/apps/org.openstreetmap.josm.png ; \
42 done
43 install -d $(CURDIR)/debian/josm/usr/share/icons/hicolor/scalable/apps
44 install -m 644 $(CURDIR)/native/linux/tested/usr/share/icons/hicolor/scalable/apps/org.openstreetmap.josm.svg $(CURDIR)/debian/josm/usr/share/icons/hicolor/scalable/apps/org.openstreetmap.josm.svg
45
46 install -m 644 $(CURDIR)/native/linux/tested/usr/share/pixmaps/org.openstreetmap.josm.png $(CURDIR)/debian/josm/usr/share/pixmaps/org.openstreetmap.josm.png
47 install -m 644 $(CURDIR)/native/linux/tested/usr/share/applications/org.openstreetmap.josm.desktop $(CURDIR)/debian/josm/usr/share/applications/org.openstreetmap.josm.desktop
48 install -m 644 $(CURDIR)/native/linux/tested/usr/share/metainfo/org.openstreetmap.josm.appdata.xml $(CURDIR)/debian/josm/usr/share/metainfo/org.openstreetmap.josm.appdata.xml
49
50 install -d $(CURDIR)/debian/josm/usr/share/mime/packages
51 install -m 644 $(CURDIR)/native/linux/tested/usr/share/mime/packages/josm.xml $(CURDIR)/debian/josm/usr/share/mime/packages
52
53 execute_after_dh_install:
54 # remove *.lang files, since we ship them in josm-l10n
55 rm -rf $(CURDIR)/debian/josm/usr/share/josm/data/*.lang
56
57 # remove executable bit
58 chmod a-x $(CURDIR)/debian/josm/usr/share/josm/data/defaultpresets.xml
59
60 # Remove empty directories
61 find $(CURDIR)/debian/josm/usr/share/josm/data -type d -empty -delete
62
63 # check font in SVG files
64 sh $(CURDIR)/debian/images-check.sh
65
66 get-orig-source:
67 dh_testdir
68 test -d ../tarballs/. || mkdir -p ../tarballs
69 @echo Downloading josm from ${SVNREPO}
70 svn export -r ${SVNREV} ${SVNREPO} ${DESTDIR}
71 @echo Removing duplicated code
72 rm -rf ${DESTDIR}/src/org/apache/commons/compress ${DESTDIR}/src/org/apache/commons/logging
73 @echo Downloading source JAR
74 wget https://josm.openstreetmap.de/download/josm-snapshot-${SVNREV}-sources.jar -O /tmp/josm-sources.jar
75 @echo Extracting sources from JAR
76 cd ${DESTDIR}/src && jar -xf /tmp/josm-sources.jar ch/poole com/drew com/google com/kitfox jakarta/annotation jakarta/json org/apache/commons org/eclipse org/tukaani && cd $$OLDPWD
77 for i in `grep "Generated By:JavaCC:" ${DESTDIR}/src/ch/poole -r | cut -d: -f1 | sort -u`; do \
78 rm -v "$$i"; \
79 done
80 cd ${DESTDIR}/resources && jar -xf /tmp/josm-sources.jar META-INF/resources/webjars/tag2link && cd $$OLDPWD
81 find ${DESTDIR}/resources/META-INF/resources/webjars/tag2link -type f -not -name index.json -delete
82 @echo Downloading xmpcore source JAR
83 wget https://repo1.maven.org/maven2/com/adobe/xmp/xmpcore/6.1.10/xmpcore-6.1.10-sources.jar -O /tmp/xmpcore-sources.jar
84 @echo Extracting xmpcore sources from JAR
85 cd ${DESTDIR}/src && jar -xf /tmp/xmpcore-sources.jar com/adobe && cd $$OLDPWD
86 @echo Downloading annotations source JAR
87 wget https://repo1.maven.org/maven2/org/jetbrains/annotations/24.0.1/annotations-24.0.1-sources.jar -O /tmp/annotations-sources.jar
88 @echo Extracting annotations sources from JAR
89 cd ${DESTDIR}/src && jar -xf /tmp/annotations-sources.jar org/jetbrains && cd $$OLDPWD
90 @echo Downloading commons-io source JAR
91 wget https://repo1.maven.org/maven2/commons-io/commons-io/2.20.0/commons-io-2.20.0-sources.jar -O /tmp/commons-io-sources.jar
92 @echo Extracting commons-io sources from JAR
93 cd ${DESTDIR}/src && jar -xf /tmp/commons-io-sources.jar org/apache && cd $$OLDPWD
94 @echo Downloading commons-lang3 source JAR
95 wget https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.16.0/commons-lang3-3.16.0-sources.jar -O /tmp/commons-lang3-sources.jar
96 @echo Extracting commons-lang3 sources from JAR
97 cd ${DESTDIR}/src && jar -xf /tmp/commons-lang3-sources.jar org/apache && cd $$OLDPWD
98 @echo Fetching revision metadata
99 svn info --xml -r ${SVNREV} ${SVNREPO} > ${DESTDIR}/REVISION
100 @echo Fetching internalization data
101 svn export ${SVNI18NREPO} ${DESTDIR}/i18n
102 @echo Downloading translations from Launchpad
103 bzr export -v ${DESTDIR}/i18n/po/ lp:~openstreetmap/josm/josm_trans/
104 @echo Stripping comments from translations to save some space in the tarball
105 for i in ${DESTDIR}/i18n/po/josm/*.po; do \
106 grep -E -v "^#[:,\.]" $$i > ${DESTDIR}/i18n/po/`basename $$i`; \
107 done
108 mv ${DESTDIR}/i18n/po/josm/*.pot ${DESTDIR}/i18n/po/
109 rm -rf ${DESTDIR}/i18n/po/josm/
110 @echo Removing jar files
111 find ${DESTDIR} -name "*.jar" -exec rm -v {} \;
112 @echo Removing nodist/images
113 rm -fr ${DESTDIR}/nodist/images
114 @echo Removing other useless data
115 rm -fr ${DESTDIR}/nodist/data/*.osm ${DESTDIR}/nodist/data/*.gpx ${DESTDIR}/nodist/data/*.jpg
116 @echo Removing non-free or autogenerated data
117 rm -fr ${DESTDIR}/resources/data/*.lang
118 rm -fr ${DESTDIR}/src/org/openstreetmap/josm/data/imagery/types/*
119 @echo Removing embedded code copy of jmapviewer
120 rm -fr ${DESTDIR}/src/org/openstreetmap/gui/jmapviewer/
121 @echo Removing embedded fonts
122 rm -fr ${DESTDIR}/resources/data/fonts/
123 @echo Removing OSX support
124 rm -fr ${DESTDIR}/native/macosx/
125 @echo Removing Windows installer
126 rm -fr ${DESTDIR}/native/windows/
127 @echo Building snapshot tarball
128 tar czf ${DESTTGZ} -C `dirname ${DESTDIR}` `basename ${DESTDIR}`
129 @echo Cleaning up
130 rm -rf ${DESTDIR}
131 @echo Moving tarball to parent directory
132 mv -v ${DESTTGZ} ../
133 @echo Removing source JAR
134 rm -f /tmp/josm-sources.jar /tmp/xmpcore-sources.jar /tmp/annotations-sources.jar /tmp/commons-io-sources.jar /tmp/commons-lang3-sources.jar
135 @echo Removing tarballs directory
136 rmdir ../tarballs
137 @echo .
138 @echo To update debian/changelog type
139 @echo dch -v ${VERSION}+dfsg-1
140 @echo .