Skip to content

Commit aff79fe

Browse files
committed
[ROSBE-UNIX] Add a script and required files to build a DEB source package.
I plan to upload that to Launchpad and have official RosBE-Unix packages hosted there. Only Ubuntu 18.04 (bionic) is supported for now, but it's easy to add more distros.
1 parent 2128875 commit aff79fe

10 files changed

Lines changed: 148 additions & 5 deletions

File tree

RosBE-Unix/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Base-i386/README.pdf
22
Base-i386/sources/*.tar.bz2
3-
RosBE-Unix-*
3+
RosBE-Unix*

RosBE-Unix/Base-i386_debian/compat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
10
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Source: rosbe-unix
2+
Section: devel
3+
Priority: optional
4+
Maintainer: Colin Finck <colin@reactos.org>
5+
Build-Depends: debhelper (>= 10), bzip2, findutils (>= 4.4), grep (>= 2.20), m4, pkg-config, python, tar (>= 1.27), texinfo, zlib1g-dev
6+
Standards-Version: 4.1.2
7+
Homepage: https://reactos.org/wiki/Build_Environment
8+
Vcs-Git: https://github.com/reactos/RosBE
9+
Vcs-Browser: https://github.com/reactos/RosBE
10+
11+
Package: rosbe-unix
12+
Architecture: amd64
13+
Depends: build-essential, ${shlibs:Depends}, ${misc:Depends}
14+
Recommends: git
15+
Description: ReactOS Build Environment for Unix-based Operating Systems
16+
The official build environment for the ReactOS operating system
17+
(https://reactos.org)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
Upstream-Name: rosbe-unix
3+
Upstream-Contact: Colin Finck <colin@reactos.org>
4+
Source: https://github.com/reactos/RosBE
5+
6+
Files: *
7+
Copyright: 2020 Colin Finck <colin@reactos.org>
8+
License: GPL-2+
9+
This package is free software; you can redistribute it and/or modify
10+
it under the terms of the GNU General Public License as published by
11+
the Free Software Foundation; either version 2 of the License, or
12+
(at your option) any later version.
13+
.
14+
This package is distributed in the hope that it will be useful,
15+
but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
GNU General Public License for more details.
18+
.
19+
You should have received a copy of the GNU General Public License
20+
along with this program. If not, see <https://www.gnu.org/licenses/>
21+
.
22+
On Debian systems, the complete text of the GNU General
23+
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
usr/RosBE/* usr/RosBE

RosBE-Unix/Base-i386_debian/rules

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/make -f
2+
3+
export DEB_CFLAGS_MAINT_SET = -pipe -O2 -Wl,-S -g0 -march=core2
4+
export DEB_CXXFLAGS_MAINT_SET = -pipe -O2 -Wl,-S -g0 -march=core2
5+
6+
%:
7+
dh $@
8+
9+
override_dh_auto_build:
10+
fakeroot ./RosBE-Builder.sh $(CURDIR)/usr/RosBE
11+
12+
override_dh_strip:
13+
# RosBE-Builder.sh already takes care of debug symbols
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.0 (quilt)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
rosbe-unix (2.2.1-1ppa1~bionic) bionic; urgency=medium
2+
3+
* Initial packaged release
4+
5+
-- Colin Finck <colin@reactos.org> Thu, 11 Jun 2020 11:57:00 +0200

RosBE-Unix/makepackage-deb.sh

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#!/usr/bin/env bash
2+
#
3+
# ReactOS Build Environment for Unix-based Operating Systems - Packaging tool for DEB source packages
4+
# Copyright 2020 Colin Finck <colin@reactos.org>
5+
#
6+
# Released under GNU GPL v2 or any later version.
7+
8+
cd `dirname $0`
9+
10+
#
11+
# Prerequisites
12+
#
13+
# Check the parameters
14+
if [[ "$3" = "" ]]; then
15+
echo "makepackage-deb - Package a RosBE-Unix version as DEB source package (for Launchpad)"
16+
echo "Syntax: ./makepackage-deb.sh <package> <version> <distro>"
17+
echo
18+
echo " package - Package name (i.e. \"Base-i386\")"
19+
echo " version - Version number of the Build Environment to package (i.e. \"1.4\")"
20+
echo " distro - Debian/Ubuntu distribution name to create a package for (i.e. \"bionic\")"
21+
exit 1
22+
fi
23+
24+
package_name="$1"
25+
package_version="$2"
26+
distro_name="$3"
27+
28+
# Set the full package name
29+
full_package_name="RosBE-Unix"
30+
31+
case "$package_name" in
32+
"Base-i386")
33+
# Add no suffix
34+
;;
35+
*)
36+
# Add the package name as the suffix
37+
full_package_name+="-$package_name"
38+
;;
39+
esac
40+
41+
debian_package_name=`echo $full_package_name | tr '[:upper:]' '[:lower:]'`
42+
debian_orig_file="${debian_package_name}_${package_version}.orig.tar.bz2"
43+
44+
full_package_name+="-$package_version"
45+
full_package_file="$full_package_name.tar.bz2"
46+
47+
# Let's hope we will never need more than one try for each distro :)
48+
debian_package_name+="_$package_version-1ppa1~$distro_name"
49+
50+
if [[ ! -d "$full_package_name" || ! -f "$full_package_file" ]]; then
51+
echo "Directory \"$full_package_name\" or file \"$full_package_file\" does not exist!"
52+
echo "Make sure that you run ./makepackage.sh beforehand."
53+
exit 1
54+
fi
55+
56+
debian_directory="${package_name}_debian"
57+
if [[ ! -d "$debian_directory" ]]; then
58+
echo "Debian package directory \"$debian_directory\" does not exist!"
59+
exit 1
60+
fi
61+
62+
distro_directory="${debian_directory}_${distro_name}"
63+
if [[ ! -d "$distro_directory" ]]; then
64+
echo "Distro-specific Debian package directory \"$distro_directory\" does not exist!"
65+
exit 1
66+
fi
67+
68+
# Create the Debian package structure
69+
rm -rf $debian_package_name
70+
rm -f $debian_package_name*
71+
72+
cp $full_package_file $debian_orig_file
73+
cp -R $full_package_name $debian_package_name
74+
cp -R $debian_directory $debian_package_name/debian
75+
cp $distro_directory/* $debian_package_name/debian
76+
77+
# Create the DEB source package for Launchpad
78+
cd $debian_package_name
79+
debuild -S

RosBE-Unix/makepackage.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
check_file()
1212
{
13-
if ! [ -f "$1" ]; then
13+
if [[ ! -f "$1" ]]; then
1414
echo "File \"$1\" is required, but does not exist!"
1515
exit 1
1616
fi
@@ -24,7 +24,7 @@ cd `dirname $0`
2424
# Prerequisites
2525
#
2626
# Check the parameters
27-
if [ "$2" = "" ]; then
27+
if [[ "$2" = "" ]]; then
2828
echo "makepackage - Package a RosBE-Unix version"
2929
echo "Syntax: ./makepackage.sh <package> <version>"
3030
echo
@@ -37,7 +37,7 @@ package_name="$1"
3737
package_version="$2"
3838

3939
# Set the full package name
40-
full_package_name="RosBE-Unix-$package_version"
40+
full_package_name="RosBE-Unix"
4141

4242
case "$package_name" in
4343
"Base-i386")
@@ -49,6 +49,9 @@ case "$package_name" in
4949
;;
5050
esac
5151

52+
full_package_name+="-$package_version"
53+
full_package_file="$full_package_name.tar.bz2"
54+
5255
# Check if the required directory structure exists
5356
if ! git status >& /dev/null; then
5457
echo "This script needs to be run in a working copy of the \"RosBE\" repository!"
@@ -100,7 +103,7 @@ done
100103

101104
# Finally create a package out of this
102105
echo "Creating the package..."
103-
tar cjf "$full_package_name.tar.bz2" "$full_package_name"
106+
tar cjf "$full_package_file" "$full_package_name"
104107

105108
echo
106109
echo "Done!"

0 commit comments

Comments
 (0)