Accepting request 205126 from openSUSE:Tools
- Move service to github.com/openSUSE/obs-service-recompress - Add _service file to update package from there - Drop local sources and use tarball from source services (forwarded request 205120 from saschpe) OBS-URL: https://build.opensuse.org/request/show/205126 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/obs-service-recompress?expand=0&rev=6
This commit is contained in:
commit
b60a55df44
19
_service
Normal file
19
_service
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<services>
|
||||||
|
<service mode="disabled" name="tar_scm">
|
||||||
|
<param name="url">git@github.com:openSUSE/obs-service-recompress.git</param>
|
||||||
|
<param name="scm">git</param>
|
||||||
|
<param name="exclude">.git</param>
|
||||||
|
<param name="version">git-master</param>
|
||||||
|
<param name="versionformat">@PARENT_TAG@</param>
|
||||||
|
<param name="revision">master</param>
|
||||||
|
<param name="changesrevision">4873976e1f935aa40bd144c221bfd1b7da558ee2</param></service>
|
||||||
|
|
||||||
|
<service mode="disabled" name="recompress">
|
||||||
|
<param name="file">*.tar</param>
|
||||||
|
<param name="compression">gz</param>
|
||||||
|
</service>
|
||||||
|
|
||||||
|
<service mode="disabled" name="set_version">
|
||||||
|
<param name="basename">obs-service-recompress</param>
|
||||||
|
</service>
|
||||||
|
</services>
|
3
obs-service-recompress-0.2.tar.gz
Normal file
3
obs-service-recompress-0.2.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:7b458102204cbdae74bd72d4da6e0c77d3a6bc4e22880ad2e5278e89d7bf81af
|
||||||
|
size 1593
|
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Oct 29 13:53:50 UTC 2013 - speilicke@suse.com
|
||||||
|
|
||||||
|
- Move service to github.com/openSUSE/obs-service-recompress
|
||||||
|
- Add _service file to update package from there
|
||||||
|
- Drop local sources and use tarball from source services
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Mar 1 18:50:01 GMT 2012 - aspiers@suse.com
|
Thu Mar 1 18:50:01 GMT 2012 - aspiers@suse.com
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package obs-service-recompress
|
# spec file for package obs-service-recompress
|
||||||
#
|
#
|
||||||
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@ -16,17 +16,19 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
|
%define service recompress
|
||||||
|
|
||||||
Name: obs-service-recompress
|
Name: obs-service-%{service}
|
||||||
|
Version: 0.2
|
||||||
|
Release: 0
|
||||||
|
Summary: An OBS source service: Recompress files
|
||||||
License: GPL-2.0+
|
License: GPL-2.0+
|
||||||
Group: Development/Tools/Building
|
Group: Development/Tools/Building
|
||||||
Summary: An OBS source service: Recompress files
|
Url: https://github.com/openSUSE/obs-service-%{service}
|
||||||
Version: 0.2
|
Source: %{name}-%{version}.tar.gz
|
||||||
Release: 1
|
Requires: bzip2
|
||||||
Url: https://build.opensuse.org/package/show?package=obs-service-recompress&project=openSUSE%3ATools
|
Requires: gzip
|
||||||
Source: recompress
|
Requires: xz
|
||||||
Source1: recompress.service
|
|
||||||
Requires: xz gzip bzip2
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
@ -42,18 +44,18 @@ It supports to compress, uncompress or recompress files from or to
|
|||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -D -T 0 -n .
|
%setup -q
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
mkdir -p $RPM_BUILD_ROOT/usr/lib/obs/service
|
mkdir -p %{buildroot}%{_prefix}/lib/obs/service
|
||||||
install -m 0755 %{SOURCE0} $RPM_BUILD_ROOT/usr/lib/obs/service
|
install -m 0755 recompress %{buildroot}%{_prefix}/lib/obs/service
|
||||||
install -m 0644 %{SOURCE1} $RPM_BUILD_ROOT/usr/lib/obs/service
|
install -m 0644 recompress.service %{buildroot}%{_prefix}/lib/obs/service
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%dir /usr/lib/obs
|
%dir %{_prefix}/lib/obs
|
||||||
/usr/lib/obs/service
|
%{_prefix}/lib/obs/service
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
99
recompress
99
recompress
@ -1,99 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# A simple script to checkout or update a svn or git repo as source service
|
|
||||||
#
|
|
||||||
# (C) 2010 by Adrian Schröter <adrian@suse.de>
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
# See http://www.gnu.org/licenses/gpl-2.0.html for full license text.
|
|
||||||
|
|
||||||
# defaults
|
|
||||||
MYCOMPRESSION=""
|
|
||||||
FILES=""
|
|
||||||
|
|
||||||
while test $# -gt 0; do
|
|
||||||
case $1 in
|
|
||||||
*-compression)
|
|
||||||
MYCOMPRESSION="$2"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*-file)
|
|
||||||
FILES="$FILES ${2##*/}"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*-outdir)
|
|
||||||
MYOUTDIR="$2"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo Unknown parameter $1.
|
|
||||||
echo 'Usage: recompress --compression $COMPRESSION --file $FILE --outdir $OUT'
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -z "$MYCOMPRESSION" ]; then
|
|
||||||
MYCOMPRESSION="bz2"
|
|
||||||
fi
|
|
||||||
if [ -z "$FILES" ]; then
|
|
||||||
echo "ERROR: no inputs files are given via --file parameter!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [ -z "$MYOUTDIR" ]; then
|
|
||||||
echo "ERROR: no output directory is given via --outdir parameter!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
for i in $FILES; do
|
|
||||||
FILE=`ls -1 "$i" || ls -1 "_service:*:$i"`
|
|
||||||
if [ ! -f "$FILE" ]; then
|
|
||||||
echo "Unknown file $i"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
UNCOMPRESS="cat"
|
|
||||||
BASENAME="$FILE"
|
|
||||||
if [ "${FILE%.gz}" != "$FILE" ]; then
|
|
||||||
UNCOMPRESS="gunzip -c"
|
|
||||||
BASENAME="${FILE%.gz}"
|
|
||||||
elif [ "${FILE%.tgz}" != "$FILE" ]; then
|
|
||||||
UNCOMPRESS="gunzip -c"
|
|
||||||
BASENAME="${FILE%.tgz}.tar"
|
|
||||||
elif [ "${FILE%.bz2}" != "$FILE" ]; then
|
|
||||||
UNCOMPRESS="bunzip2 -c"
|
|
||||||
BASENAME="${FILE%.bz2}"
|
|
||||||
elif [ "${FILE%.xz}" != "$FILE" ]; then
|
|
||||||
UNCOMPRESS="xz -dc"
|
|
||||||
BASENAME="${FILE%.xz}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$MYCOMPRESSION" == "gz" ]; then
|
|
||||||
COMPRESS="gzip -c -n --rsyncable -"
|
|
||||||
NEWFILE="${BASENAME#_service:}.gz"
|
|
||||||
elif [ "$MYCOMPRESSION" == "bz2" ]; then
|
|
||||||
COMPRESS="bzip2 -c -"
|
|
||||||
NEWFILE="${BASENAME#_service:}.bz2"
|
|
||||||
elif [ "$MYCOMPRESSION" == "xz" ]; then
|
|
||||||
COMPRESS="xz -c -"
|
|
||||||
NEWFILE="${BASENAME#_service:}.xz"
|
|
||||||
elif [ "$MYCOMPRESSION" == "none" ]; then
|
|
||||||
COMPRESS="cat -"
|
|
||||||
NEWFILE="${BASENAME#_service:}"
|
|
||||||
else
|
|
||||||
echo "ERROR: Unknown compression $MYCOMPRESSION"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# do the real work
|
|
||||||
$UNCOMPRESS "$FILE" | $COMPRESS > "$MYOUTDIR/$NEWFILE" || exit 1
|
|
||||||
echo "Compressed $FILE to $NEWFILE"
|
|
||||||
|
|
||||||
# we can remove service files, no need to store them twice
|
|
||||||
rm -f "$FILE"
|
|
||||||
done
|
|
||||||
|
|
||||||
exit 0
|
|
@ -1,22 +0,0 @@
|
|||||||
<service name="recompress">
|
|
||||||
<summary>Change File Compression</summary>
|
|
||||||
<description>This service supports to compress, uncompress or recompress files from or to
|
|
||||||
none : No Compression
|
|
||||||
gz : Gzip Compression
|
|
||||||
bz2 : Bzip2 Compression
|
|
||||||
xz : XZ Compression
|
|
||||||
</description>
|
|
||||||
<parameter name="compression">
|
|
||||||
<description>Used compression</description>
|
|
||||||
<allowedvalue>none</allowedvalue>
|
|
||||||
<allowedvalue>gz</allowedvalue>
|
|
||||||
<allowedvalue>bz2</allowedvalue>
|
|
||||||
<allowedvalue>xz</allowedvalue>
|
|
||||||
<required/>
|
|
||||||
</parameter>
|
|
||||||
<parameter name="file">
|
|
||||||
<description>name of file to be recompressed. RegExp are allowed.</description>
|
|
||||||
<required/>
|
|
||||||
</parameter>
|
|
||||||
</service>
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user