File: create-deb

package info (click to toggle)
xaos 4.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,528 kB
  • sloc: cpp: 24,154; ansic: 2,936; sh: 303; xml: 146; python: 39; makefile: 3
file content (120 lines) | stat: -rwxr-xr-x 3,292 bytes parent folder | download
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/usr/bin/env bash

# Usage: ./create-deb [build-dir]
# where build-dir points to the build folder (on qmake builds, ../bin, this is the default).

# This script creates a .deb package of XaoS 4.3 and above.
# Make sure you build the program first ("qmake6 PREFIX=/usr && make -j`nproc`"
# or "mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr && make -j`nproc`").
# Required packages before running this script:
# lynx pandoc git-extras lintian

set -x
set -e

BUILD_DIR="$1"

if [ "$BUILD_DIR" = "" ]; then
 BUILD_DIR="../bin/"
 fi

test -x "$BUILD_DIR/XaoS" || {
    echo "Missing $BUILD_DIR/XaoS. Build XaoS first."
    exit 1
    }

test -d ../bin || {
    mkdir ../bin
    cp -R $BUILD_DIR/XaoS ../bin/xaos
    }

test -x ../bin/xaos
strip ../bin/xaos

ARCH=$(dpkg --print-architecture)
LINUX_VARIANT=$(lsb_release -s -i)
LINUX_VERSION=$(lsb_release -s -r)

PLATFORMCODE=$LINUX_VARIANT-$LINUX_VERSION

MAINDIR=$(cd ..; pwd)
XAOS_VERSION=$(cat "$MAINDIR/src/include/config.h" | grep XaoS_VERSION | awk '{print $3}' | sed s/\"//g)

FSDIR=xaos_${XAOS_VERSION}-${PLATFORMCODE}_$ARCH
rm -rf "$FSDIR"

BINDIR=$FSDIR/usr/bin
mkdir -p "$BINDIR"
cp "$MAINDIR/bin/xaos" "$BINDIR"

CATDIR=$FSDIR/usr/share/XaoS/catalogs
mkdir -p "$CATDIR"
cp "$MAINDIR"/catalogs/*.cat "$CATDIR"

TUTDIR=$FSDIR/usr/share/XaoS/tutorial
mkdir -p "$TUTDIR"
cp "$MAINDIR"/tutorial/*.{xaf,xhf} "$TUTDIR"

EXDIR=$FSDIR/usr/share/XaoS/examples
mkdir -p "$EXDIR"
find "$MAINDIR/examples" -name '*.xpf' -exec cp {} "$EXDIR" \; # flattening folders

MANDIR=$FSDIR/usr/share/man/man6
mkdir -p "$MANDIR"
cp "$MAINDIR/doc/xaos.6" "$MANDIR"
gzip -9n "$MANDIR/xaos.6"

DOCDIR=$FSDIR/usr/share/doc/xaos
mkdir -p "$DOCDIR"
cp "$MAINDIR/COPYING" "$MAINDIR/NEWS" "$DOCDIR"
for i in CREDITS README; do
    pandoc "$MAINDIR/$i.md" | lynx -stdin -dump -nolist > "$DOCDIR/$i"
done
gzip -n "$DOCDIR/NEWS"

echo "Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: xaos
Source: https://github.com/xaos-project/XaoS

Files: *
Copyright: 1996-2025 XaoS Contributors
License: GPL-1" > "$DOCDIR/copyright"

git-changelog -x > "$DOCDIR/changelog"
gzip -9n "$DOCDIR/changelog"

PIXDIR=$FSDIR/usr/share/pixmaps
mkdir -p "$PIXDIR"
cp "$MAINDIR/xdg/xaos.png" "$PIXDIR"

APPDIR=$FSDIR/usr/share/applications
mkdir -p "$APPDIR"
cp "$MAINDIR/xdg/io.github.xaos_project.XaoS.desktop" "$APPDIR"

mkdir -p "$FSDIR/DEBIAN"
echo -n "Package: xaos
Version: $XAOS_VERSION
Section: graphics
Priority: optional
Architecture: $ARCH
Depends: " > "$FSDIR/DEBIAN/control"
./dep-deb-versions >> "$FSDIR/DEBIAN/control"
echo "
Maintainer: Zoltan Kovacs <zoltan@geogebra.org>
Description: zoom and pan around a fractal in
 real time. It can display the animated fractals.
 It displays the Mandelbrot set or many other fractals and
 allows you to zoom smoothly into the fractal. Various coloring
 modes are provided for both the points inside and outside the
 selected set. In addition, switching between Mandelbrot and Julia
 fractal types is provided.
 Other features include autopilot mode, palette changing,
 image saving, fractal inversion, filters, and a built in fractal
 tutorial.
" >> "$FSDIR/DEBIAN/control"

# Fix permissions
chmod -R g-w "$FSDIR"

fakeroot dpkg-deb --build "$FSDIR"
lintian "$FSDIR.deb"