Skip to content

Commit 645ca98

Browse files
committed
RedHat build script: support for overriding release
* Use the same entry point for calling `rpmbuild' * The rpm release can be overridden by `--release <release>' from the CL * Simplified build error handling * Automatically determine ${NEXTSPACE_DIR} in `build_all.sh' * Make `build_all.sh' work again
1 parent 632e638 commit 645ca98

22 files changed

+114
-131
lines changed

Packaging/RedHat/0.build_libraries.sh

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,53 +8,25 @@ BUILD_RPM=1
88
. `dirname $0`/../functions.sh
99
. `dirname $0`/../environment.sh
1010

11-
prepare_redhat_environment
12-
if [ $? -ne 0 ];then
13-
print_ERR "Failed to setup building environment. Exiting..."
14-
exit 1
15-
fi
11+
prepare_redhat_environment || error_exit "Failed to setup building environment. Exiting..."
1612

1713
# Apple Grand Central Dispatch
18-
`dirname $0`/build_libdispatch.sh $1
19-
if [ $? -ne 0 ]; then
20-
echo "Aborting..."
21-
exit 1
22-
fi
14+
`dirname $0`/build_libdispatch.sh "$@" || abort_with_message
2315

2416
# Apple Core Foundation
25-
`dirname $0`/build_libcorefoundation.sh $1
26-
if [ $? -ne 0 ]; then
27-
echo "Aborting..."
28-
exit 1
29-
fi
17+
`dirname $0`/build_libcorefoundation.sh "$@" || abort_with_message
3018

3119
# GNUstep Objective-C runtime
32-
`dirname $0`/build_libobjc2.sh $1
33-
if [ $? -ne 0 ]; then
34-
echo "Aborting..."
35-
exit 1
36-
fi
20+
`dirname $0`/build_libobjc2.sh "$@" || abort_with_message
3721

3822
# NextSpace Core
39-
`dirname $0`/build_nextspace-core.sh $1
40-
if [ $? -ne 0 ]; then
41-
echo "Aborting..."
42-
exit 1
43-
fi
23+
`dirname $0`/build_nextspace-core.sh "$@" || abort_with_message
4424

4525
# Raster graphics manipulation
46-
`dirname $0`/build_libwraster.sh $1
47-
if [ $? -ne 0 ]; then
48-
echo "Aborting..."
49-
exit 1
50-
fi
26+
`dirname $0`/build_libwraster.sh "$@" || abort_with_message
5127

5228
# GNUstep libraries
53-
`dirname $0`/build_nextspace-gnustep.sh $1
54-
if [ $? -ne 0 ]; then
55-
echo "Aborting..."
56-
exit 1
57-
fi
29+
`dirname $0`/build_nextspace-gnustep.sh "$@" || abort_with_message
5830

5931
print_OK " Build and install of NEXTSPACE Libraries SUCCEEDED!"
6032

Packaging/RedHat/1.build_frameworks.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ BUILD_RPM=1
77
. `dirname $0`/../functions.sh
88
. `dirname $0`/../environment.sh
99

10-
prepare_redhat_environment
11-
if [ $? -ne 0 ];then
12-
print_ERR "Failed to setup building environment. Exiting..."
13-
exit 1
14-
fi
10+
prepare_redhat_environment || error_exit "Failed to setup building environment. Exiting..."
1511

1612
LOG_FILE=${CWD}/frameworks_build.log
1713
SPEC_FILE=${PROJECT_DIR}/Packaging/RedHat/SPECS/nextspace-frameworks.spec
@@ -32,12 +28,12 @@ mv ${PROJECT_DIR}/nextspace-frameworks-${FRAMEWORKS_VERSION}.tar.gz ${RPM_SOURCE
3228
spectool -g -R ${SPEC_FILE}
3329

3430
print_H2 "===== Building nextspace-frameworks package..."
35-
rpmbuild -bb ${SPEC_FILE}
31+
run_rpmbuild ${SPEC_FILE} "$@"
3632
STATUS=$?
3733
if [ $STATUS -eq 0 ]; then
3834
print_OK " Building of NEXTSPACE Frameworks RPM SUCCEEDED!"
3935
print_H2 "===== Installing nextspace-frameworks RPMs..."
40-
FRAMEWORKS_VERSION=`rpm_version ${SPEC_FILE}`
36+
FRAMEWORKS_VERSION=`rpm_version ${SPEC_FILE} "$@"`
4137

4238
install_rpm nextspace-frameworks ${RPMS_DIR}/nextspace-frameworks-${FRAMEWORKS_VERSION}.rpm
4339
mv ${RPMS_DIR}/nextspace-frameworks-${FRAMEWORKS_VERSION}.rpm ${RELEASE_USR}

Packaging/RedHat/2.build_applications.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ BUILD_RPM=1
77
. `dirname $0`/../functions.sh
88
. `dirname $0`/../environment.sh
99

10-
prepare_redhat_environment
11-
if [ $? -ne 0 ];then
12-
print_ERR "Failed to setup building environment. Exiting..."
13-
exit 1
14-
fi
10+
prepare_redhat_environment || error_exit "Failed to setup building environment. Exiting..."
1511

1612
LOG_FILE=/dev/null
1713
SPEC_FILE=${PROJECT_DIR}/Packaging/RedHat/SPECS/nextspace-applications.spec
@@ -36,12 +32,12 @@ mv ${PROJECT_DIR}/nextspace-applications-${APPLICATIONS_VERSION}.tar.gz ${RPM_SO
3632
spectool -g -R ${SPEC_FILE}
3733

3834
print_H2 "===== Building nextspace-applications package..."
39-
rpmbuild -bb ${SPEC_FILE}
35+
run_rpmbuild ${SPEC_FILE} "$@"
4036
STATUS=$?
4137
if [ $STATUS -eq 0 ]; then
4238
print_OK " Building of NEXTSPACE Applications RPM SUCCEEDED!"
4339
print_H2 "===== Installing nextspace-applications RPMs..."
44-
APPLICATIONS_VERSION=`rpm_version ${SPEC_FILE}`
40+
APPLICATIONS_VERSION=`rpm_version ${SPEC_FILE} "$@"`
4541

4642
install_rpm nextspace-applications ${RPMS_DIR}/nextspace-applications-${APPLICATIONS_VERSION}.rpm
4743
mv ${RPMS_DIR}/nextspace-applications-${APPLICATIONS_VERSION}.rpm ${RELEASE_USR}

Packaging/RedHat/3.build_selinux.sh

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,10 @@ BUILD_RPM=1
88
. `dirname $0`/../functions.sh
99
. `dirname $0`/../environment.sh
1010

11-
if [ $# -eq 0 ];then
12-
print_help
13-
exit 1
14-
fi
15-
16-
prepare_redhat_environment
17-
if [ $? -ne 0 ];then
18-
print_ERR "Failed to setup building environment. Exiting..."
19-
exit 1
20-
fi
21-
22-
REPO_DIR=$1
11+
prepare_redhat_environment || error_exit "Failed to setup building environment. Exiting..."
2312

2413
# NextSpace SELinux
25-
`dirname $0`/build_nextspace-selinux.sh $1
26-
if [ $? -ne 0 ]; then
27-
echo "Aborting..."
28-
exit 1
29-
fi
14+
`dirname $0`/build_nextspace-selinux.sh "$@" || abort_with_message
3015

3116
print_OK " Build and install of NEXTSPACE SELinux SUCCEEDED!"
3217

Packaging/RedHat/SPECS/libcorefoundation.spec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
%global toolchain clang
2+
%{!?release:%global release 1}
23
%define CFNET_VERSION 129.20
34

45
Name: libcorefoundation
56
Version: 5.9.2
67
Epoch: 0
7-
Release: 1%{?dist}
8+
Release: %{release}%{?dist}
89
Summary: Apple CoreFoundation framework.
910
License: Apache 2.0
1011
URL: https://github.com/trunkmaster/apple-corefoundation

Packaging/RedHat/SPECS/libdispatch.spec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
%global toolchain clang
2+
%{!?release:%global release 1}
23

34
Name: libdispatch
45
Epoch: 1
56
Version: 5.9.2
6-
Release: 1%{?dist}
7+
Release: %{release}%{?dist}
78
Summary: Grand Central Dispatch (GCD or libdispatch).
89
License: Apache 2.0
910
URL: https://github.com/apple/swift-corelibs-libdispatch

Packaging/RedHat/SPECS/libobjc2.spec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
%global toolchain clang
2+
%{!?release:%global release 0}
23
%global _hardened_build 0
34

45
Name: libobjc2
56
Version: 2.2.1
6-
Release: 0%{?dist}
7+
Release: %{release}%{?dist}
78
Summary: GNUstep Objecttive-C runtime library.
89
License: GPL v2.0
910
URL: https://github.com/gnustep/libobjc2

Packaging/RedHat/SPECS/libwraster.spec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
%global toolchain clang
2+
%{!?release:%global release 0}
23
%define WRASTER_VERSION 7.0.1
34

45
Name: libwraster
56
Version: %{WRASTER_VERSION}
6-
Release: 0%{?dist}
7+
Release: %{release}%{?dist}
78
Summary: Raster graphics library.
89
Group: Libraries/NextSpace
910
License: GPLv3

Packaging/RedHat/SPECS/nextspace-applications.spec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
%global toolchain clang
2+
%{!?release:%global release 0}
23

34
Name: nextspace-applications
45
Version: 0.95
5-
Release: 0%{?dist}
6+
Release: %{release}%{?dist}
67
Summary: NextSpace desktop core applications.
78

89
Group: Libraries/NextSpace

Packaging/RedHat/SPECS/nextspace-core.spec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
%global debug_package %{nil}
2+
%{!?release:%global release 12}
23
%global _hardened_build 0
34

45
%define MAKE_VERSION 2_9_2
56

67
Name: nextspace-core
78
Version: 0.95
8-
Release: 12%{?dist}
9+
Release: %{release}%{?dist}
910
Summary: NextSpace filesystem hierarchy and system files.
1011
License: GPLv2
1112
URL: http://github.com/trunkmaster/nextspace

0 commit comments

Comments
 (0)