-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Docker support and bump to 14.0.1
- Loading branch information
Showing
13 changed files
with
273 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
*~ | ||
*.log | ||
SOURCES/*.bz2 | ||
SOURCES/*.gz | ||
SRPMS | ||
RPMS | ||
t/ | ||
rpmbuild/SOURCES/*.bz2 | ||
rpmbuild/SOURCES/*.gz | ||
rpmbuild/cache | ||
rpmbuild/output | ||
pkg/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
FROM centos:7 | ||
MAINTAINER DevOps <[email protected]> | ||
|
||
RUN yum -y --setopt="tsflags=nodocs" update && \ | ||
yum -y --setopt="tsflags=nodocs" install epel-release mock rpm-sign expect \ | ||
bash ca-certificates git make yum-utils rpmdevtools && \ | ||
yum clean all && \ | ||
rm -rf /var/cache/yum/ | ||
|
||
#Configure users | ||
RUN useradd -u 1000 -G mock builder && \ | ||
chmod g+w /etc/mock/*.cfg | ||
|
||
VOLUME ["/rpmbuild"] | ||
|
||
ONBUILD COPY mock /etc/mock | ||
ADD ./site-defaults-extra.cfg /etc/mock/ | ||
|
||
# create mock cache on external volume to speed up build | ||
RUN install -g mock -m 2775 -d /rpmbuild/cache/mock | ||
RUN echo "config_opts['cache_topdir'] = '/rpmbuild/cache/mock'" >> /etc/mock/site-defaults.cfg | ||
|
||
RUN cat /etc/mock/site-defaults-extra.cfg >> /etc/mock/site-defaults.cfg | ||
|
||
ADD ./build-rpm.sh /build-rpm.sh | ||
RUN chmod +x /build-rpm.sh | ||
#RUN setcap cap_sys_admin+ep /usr/sbin/mock | ||
ADD ./rpm-sign.exp /rpm-sign.exp | ||
RUN chmod +x /rpm-sign.exp | ||
|
||
USER builder | ||
ENV HOME /home/builder | ||
CMD ["/build-rpm.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
#!/bin/bash | ||
|
||
MOCK_BIN=/usr/bin/mock | ||
MOCK_CONF_FOLDER=/etc/mock | ||
MOUNT_POINT=/rpmbuild | ||
OUTPUT_FOLDER=$MOUNT_POINT/output | ||
CACHE_FOLDER=$MOUNT_POINT/cache/mock | ||
MOCK_DEFINES=($MOCK_DEFINES) # convert strings into array items | ||
DEF_SIZE=${#MOCK_DEFINES[@]} | ||
|
||
if [ $DEF_SIZE -gt 0 ]; | ||
then | ||
for ((i=0; i<$DEF_SIZE; i++)); | ||
do | ||
#MOCK_DEFINES{$i}=$(echo ${MOCK_DEFINES[$i]} |sed 's/=/ /g') | ||
DEFINE_CMD+="--define '$(echo ${MOCK_DEFINES[$i]} |sed 's/=/ /g')' " | ||
done | ||
fi | ||
|
||
#$DEFINE_CMD=$(printf %s $DEFINE_CMD) | ||
if [ -z "$MOCK_CONFIG" ]; then | ||
echo "MOCK_CONFIG is empty. Should bin one of: " | ||
ls -l $MOCK_CONF_FOLDER | ||
fi | ||
if [ ! -f "${MOCK_CONF_FOLDER}/${MOCK_CONFIG}.cfg" ]; then | ||
echo "MOCK_CONFIG is invalid. Should bin one of: " | ||
ls -l $MOCK_CONF_FOLDER | ||
fi | ||
if [ -z "$SOURCE_RPM" ] && [ -z "$SPEC_FILE" ]; then | ||
echo "You need to provide the src.rpm or spec file to build" | ||
echo "Set SOURCE_RPM or SPEC_FILE environment variables" | ||
exit 1 | ||
fi | ||
if [ ! -z "$NO_CLEANUP" ]; then | ||
echo "WARNING: Disabling clean up of the build folder after build." | ||
fi | ||
|
||
#If proxy env variable is set, add the proxy value to the configuration file | ||
if [ ! -z "$HTTP_PROXY" ] || [ ! -z "$http_proxy" ]; then | ||
TEMP_PROXY="" | ||
if [ ! -z "$HTTP_PROXY" ]; then | ||
TEMP_PROXY=$(echo $HTTP_PROXY | sed s/\\//\\\\\\//g) | ||
fi | ||
if [ ! -z "$http_proxy" ]; then | ||
TEMP_PROXY=$(echo $http_proxy | sed s/\\//\\\\\\//g) | ||
fi | ||
|
||
echo "Configuring http proxy to the mock build file to: $TEMP_PROXY" | ||
cp /etc/mock/$MOCK_CONFIG.cfg /tmp/$MOCK_CONFIG.cfg | ||
sed s/\\[main\\]/\[main\]\\\nproxy=$TEMP_PROXY/g /tmp/$MOCK_CONFIG.cfg > /etc/mock/$MOCK_CONFIG.cfg | ||
fi | ||
|
||
OUTPUT_FOLDER=${OUTPUT_FOLDER}/${MOCK_CONFIG} | ||
if [ ! -d "$OUTPUT_FOLDER" ]; then | ||
mkdir -p $OUTPUT_FOLDER | ||
else | ||
rm -f $OUTPUT_FOLDER/* | ||
fi | ||
|
||
if [ ! -d "$CACHE_FOLDER" ]; then | ||
mkdir -p $CACHE_FOLDER | ||
fi | ||
|
||
echo "=> Building parameters:" | ||
echo "========================================================================" | ||
echo " MOCK_CONFIG: $MOCK_CONFIG" | ||
#Priority to SOURCE_RPM if both source and spec file env variable are set | ||
if [ ! -z "$SOURCE_RPM" ]; then | ||
echo " SOURCE_RPM: $SOURCE_RPM" | ||
echo " OUTPUT_FOLDER: $OUTPUT_FOLDER" | ||
echo "========================================================================" | ||
if [ ! -z "$NO_CLEANUP" ]; then | ||
echo "$MOCK_BIN $DEFINE_CMD -r $MOCK_CONFIG --rebuild $MOUNT_POINT/$SOURCE_RPM --resultdir=$OUTPUT_FOLDER --no-clean" > $OUTPUT_FOLDER/script-test.sh | ||
else | ||
echo "$MOCK_BIN $DEFINE_CMD -r $MOCK_CONFIG --rebuild $MOUNT_POINT/$SOURCE_RPM --resultdir=$OUTPUT_FOLDER" > $OUTPUT_FOLDER/script-test.sh | ||
fi | ||
elif [ ! -z "$SPEC_FILE" ]; then | ||
if [ -z "$SOURCES" ]; then | ||
echo "You need to specify SOURCES env variable pointing to folder or sources file (only when building with SPEC_FILE)" | ||
exit 1; | ||
fi | ||
echo " SPEC_FILE: $SPEC_FILE" | ||
echo " SOURCES: $SOURCES" | ||
echo " OUTPUT_FOLDER: $OUTPUT_FOLDER" | ||
echo " MOCK_DEFINES: $MOCK_DEFINES" | ||
echo "========================================================================" | ||
# Download dependencies | ||
spectool -C $MOUNT_POINT/$SOURCES -g $MOUNT_POINT/$SPEC_FILE | ||
if [ ! -z "$NO_CLEANUP" ]; then | ||
# do not cleanup chroot between both mock calls as 1st does not alter it | ||
echo "$MOCK_BIN $DEFINE_CMD -r $MOCK_CONFIG --buildsrpm --spec=$MOUNT_POINT/$SPEC_FILE --sources=$MOUNT_POINT/$SOURCES --resultdir=$OUTPUT_FOLDER --no-cleanup-after" > $OUTPUT_FOLDER/script-test.sh | ||
echo "$MOCK_BIN $DEFINE_CMD -r $MOCK_CONFIG --rebuild \$(find $OUTPUT_FOLDER -type f -name \"*.src.rpm\") --resultdir=$OUTPUT_FOLDER --no-clean" >> $OUTPUT_FOLDER/script-test.sh | ||
else | ||
echo "$MOCK_BIN $DEFINE_CMD -r $MOCK_CONFIG --buildsrpm --spec=$MOUNT_POINT/$SPEC_FILE --sources=$MOUNT_POINT/$SOURCES --resultdir=$OUTPUT_FOLDER" > $OUTPUT_FOLDER/script-test.sh | ||
echo "$MOCK_BIN $DEFINE_CMD -r $MOCK_CONFIG --rebuild \$(find $OUTPUT_FOLDER -type f -name \"*.src.rpm\") --resultdir=$OUTPUT_FOLDER" >> $OUTPUT_FOLDER/script-test.sh | ||
fi | ||
fi | ||
|
||
chmod 755 $OUTPUT_FOLDER/script-test.sh | ||
$OUTPUT_FOLDER/script-test.sh | ||
|
||
rm $OUTPUT_FOLDER/script-test.sh | ||
|
||
|
||
if [ ! -z "$SIGNATURE" ]; then | ||
echo "%_signature gpg" > $HOME/.rpmmacros | ||
echo "%_gpg_name ${SIGNATURE}" >> $HOME/.rpmmacros | ||
echo "Signing RPM using ${SIGNATURE} key" | ||
find $OUTPUT_FOLDER -type f -name "*.rpm" -exec /rpm-sign.exp {} ${GPG_PASS} \; | ||
else | ||
echo "No RPMs signature requested" | ||
fi | ||
|
||
echo "Build finished. Check results inside the mounted volume folder." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/expect | ||
|
||
### rpm-sign.exp -- Sign RPMs by sending the passphrase. | ||
set file [lindex $argv 0] | ||
set pass [lindex $argv 1] | ||
spawn rpm --resign $file | ||
expect -exact "Enter pass phrase: " | ||
send -- "$pass\r" | ||
expect eof | ||
|
||
### End of rpm-sign.exp |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
%define statedir /run | ||
%endif | ||
|
||
%define base_version 13.0.6 | ||
%define base_version 14.0.1 | ||
%define rel %(echo 1) | ||
|
||
Name: nextcloud | ||
|
@@ -222,6 +222,7 @@ fi | |
%{apache_serverroot}/%{name}/lib | ||
%{apache_serverroot}/%{name}/ocs | ||
%{apache_serverroot}/%{name}/ocs-provider | ||
%{apache_serverroot}/%{name}/ocm-provider | ||
%{apache_serverroot}/%{name}/resources | ||
%{apache_serverroot}/%{name}/settings | ||
%{apache_serverroot}/%{name}/themes | ||
|
@@ -242,6 +243,12 @@ fi | |
%{apache_serverroot}/%{name}/data | ||
|
||
%changelog | ||
* Thu Oct 04 2018 Marko Bevc <[email protected]> - 14.0.1-1 | ||
- Update to version 14. | ||
|
||
* Thu Oct 04 2018 Marko Bevc <[email protected]> - 13.0.6-2 | ||
- Switch to Docker build. | ||
|
||
* Sun Sep 02 2018 Marko Bevc <[email protected]> - 13.0.6-1 | ||
- Update version. | ||
|
||
|