Blob Blame History Raw
%global commit 648f4ae7311d1ad00658fc314e1a6c896f47e618
%global tag 9
%global githead %(printf %%.7s %commit)
%global gitdate 20140710

# Module Sample: (Alpha Version)
# % global moduleX %name-of-module
#
# % package -n %{moduleX}
# Summary: %{summary_of_moduleX}
# License: %{license_of_moduleX}
#
# % description -n %{moduleX}
# %description-of-module
#
# % prep
# ./gnulib-tool --create-testdir --dir=build-%{moduleX} %{moduleX}
#
# % build
# pushd build-%{moduleX}
# % configure --prefix=%_prefix
# make %{?_smp_mflags}
# popd
#
# % install
# pushd build-%{moduleX}
# make %{?_smp_mflags} install DESTDIR=%{buildroot}
# popd
# help2man -N --no-discard-stderr %{buildroot}%{_bindir}/%{moduleX} | gzip -9c > %{buildroot}%{_mandir}/man1/%{moduleX}.1.gz
#
# % files -n %{moduleX}
# %{_bindir}/%{moduleX}
# %{_mandir}/*/%{moduleX}.*

##################################
# LIST OF SINGLE MODULE PACKAGES :
# 1.git-merge-changelog
##################################

%global module1 git-merge-changelog
%global common_desc \
The GNU portability library is a macro system and C declarations and \
definitions for commonly-used API elements and abstracted system behaviors. \
It can be used to improve portability and other functionality in your programs.

Name:				gnulib
Version:			0
Release:			%{tag}.%{gitdate}git%{?dist}.1
Summary:			GNU Portability Library
Group:				Development/System
License:			Public Domain and BSD and GPLv2+ and GPLv3 and GPLv3+ and LGPLv2 and LGPLv2+ and LGPLv3+
URL:				http://www.gnu.org/software/gnulib
Source0:			http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=snapshot;h=%{githead};sf=tgz;name=%{name}-%{githead}.tar.gz
Source1:			http://erislabs.net/gitweb/?p=gnulib.git;a=blob_plain;hb=HEAD;f=debian/manpages/check-module.1
Source2:			http://erislabs.net/gitweb/?p=gnulib.git;a=blob_plain;hb=HEAD;f=debian/manpages/gnulib-tool.1
BuildRequires:		texinfo
BuildRequires:		java-devel

# For building Modules, all gnulib requires must be found, Modules BRs:
BuildRequires:		gettext-devel
BuildRequires:		bison
BuildRequires:		gperf
BuildRequires:		libtool
BuildRequires:		help2man

%description
%common_desc

%prep
%setup -q -n %{name}-%{githead}

#modules not to be tested by direct import
toRemove="lib-symbol-visibility havelib .*-obsolete localcharset gettext-h gettext alloca-opt alloca "

list="$(./gnulib-tool --list)"
for item in $toRemove
do
   list="$(echo $list| sed "s:\b$item\b::g")"
done
#is necessary to avoid some modules to test prep pass
./gnulib-tool --create-testdir --with-tests --with-obsolete --avoid=alloca --avoid=lib-symbol-visibility --avoid=havelib --dir=build-tests $list

rm lib/javaversion.class
# MODULE #1 - git-merge-changelog
./gnulib-tool --create-testdir --dir=build-%{module1} %{module1}

%build
# MODULE #1 - git-merge-changelog
pushd build-%{module1}
%configure --prefix=%_prefix
make %{?_smp_mflags}
popd
#tests build
pushd build-tests
%configure --prefix=%_prefix
make %{?_smp_mflags}
popd
# Rebuild removed java class
javac -d lib -source 1.3 -target 1.3 lib/javaversion.java
# This part is done with the original path
make %{?_smp_mflags} MODULES.html
sed -i -r 's#HREF="(lib|m4|modules)#HREF="%{_datadir}/%{name}/\1#g' MODULES.html
sed -i "/^[ ]*gnulib_dir=/s#\`[^\`]*\`#%{_datadir}/%{name}#" gnulib-tool
# This part is done with the target path
make %{?_smp_mflags} info html
# Removing unused files
rm -f */.cvsignore
rm -f */.gitignore
rm -f */.gitattributes
rm -f lib/.cppi-disable
rm -f lib/uniname/gen-uninames.lisp

%check
pushd build-tests
make check
popd

%install
mkdir -p %{buildroot}%{_datadir}/%{name}
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_datadir}/info
mkdir -p %{buildroot}%{_pkgdocdir}
mkdir -p %{buildroot}%{_mandir}/man1

cp -p check-module %{buildroot}%{_bindir}
cp -p gnulib-tool %{buildroot}%{_bindir}
cp -rp build-aux lib m4 modules config tests %{buildroot}%{_datadir}/%{name}/

cp -p doc/gnulib.info %{buildroot}%{_datadir}/info/
cp -p doc/gnulib.html MODULES.html NEWS COPYING ChangeLog users.txt doc/COPYING* %{buildroot}%{_pkgdocdir}/
cp -p %{SOURCE1} %{SOURCE2} %{buildroot}%{_mandir}/man1

# Module installing
pushd build-%{module1}
make %{?_smp_mflags} install DESTDIR=%{buildroot}
popd
help2man -N --no-discard-stderr %{buildroot}%{_bindir}/%{module1} | gzip -9c > %{buildroot}%{_mandir}/man1/%{module1}.1.gz

#-------------------------------------------------------------------------

%package docs
Summary: Documentation for %{name} modules
License: GFDL
Requires(post):		info
Requires(preun):	info
Requires:			%{name}-devel = %{version}-%{release}
BuildArch: noarch

%description docs
%common_desc

This package contains documentation for %{name}.

%post docs
/sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :

%preun docs
if [ $1 = 0 ] ; then
  /sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || :
fi

%files docs
%{_datadir}/info/gnulib.info.gz
%{_pkgdocdir}/gnulib.html
%{_pkgdocdir}/MODULES.html
# license text is included directly in info and html files.

#-------------------------------------------------------------------------

%package devel
Summary: Devel files of %{name}
BuildArch: noarch
Provides: gnulib
Requires: gettext-devel
Requires: bison
Requires: coreutils
Requires: gperf
Requires: libtool
Requires: make
Requires: texinfo
Requires: diffutils
Requires: patch

%description devel
%common_desc

This package contains devel files of %{name}.

%files devel
%{_datadir}/%{name}/
%{_bindir}/gnulib-tool
%{_bindir}/check-module
%{_mandir}/*/check-module.*
%{_mandir}/*/gnulib-tool.*
%{_pkgdocdir}/
%exclude %{_pkgdocdir}/MODULES.html
%exclude %{_pkgdocdir}/gnulib.html

#-------------------------------------------------------------------------

# MODULE #1 - git-merge-changelog
%package -n %{module1}
Summary: Git merge driver for ChangeLog files
License: GPLv2+

%description -n %{module1}
Git Merge Changelog is a git merge driver for changelogs that combines
parallel additions to the changelog without generating merge conflicts.
It can be enabled for specific files by setting appropriate git attributes.

%files -n %{module1}
%{_bindir}/%{module1}
%{_mandir}/*/%{module1}.*
%doc doc/COPYINGv2

#-------------------------------------------------------------------------

%changelog
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-9.20140710git.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Thu Jul 10 2014 Mosaab Alzoubi <moceap@hotmail.com> - 0-9.20140710git
- Update on 20140710.
- Fix unneed numbers of release line after (FRE).

* Fri Jun 27 2014 Jakub Čajka <jcajka@redhat.com> - 0-8.20140504git.2
- Added tests

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-8.20140504git.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sun May 4 2014 Mosaab Alzoubi <moceap@hotmail.com> - 0-8.20140504git
- Update on 20140504.

* Mon Mar 03 2014 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0-7.20140225git
- Update to latest git.

* Mon Jan 27 2014 Mosaab Alzoubi <moceap@hotmail.com> - 0-6.20140127git
- Update on 20140127.

* Thu Jan 9 2014 Mosaab Alzoubi <moceap@hotmail.com> - 0-5.20140109git
- Update on 20140109.

* Thu Dec 19 2013 Mosaab Alzoubi <moceap@hotmail.com> - 0-4.20131219git
- Update.
- General tweaks.
- Remove META main package.
- Rename -core into -devel.
- Remove main package from other packages requires.
- -docs requires -devel.
- Move main requires to -devel ones.
- -devel provides main package.
- Remove un-need-to-list-BRs diffutils make coreutils patch.
- United path for documents for all packages.

* Sun Dec 1 2013 Mosaab Alzoubi <moceap@hotmail.com> - 0-3.20131201git
- Update.

* Thu Nov 14 2013 Mosaab Alzoubi <moceap@hotmail.com> - 0-2.20131112git
- Fix tag method to 0-$rel.$gitdategit instead of $ver.git$gitdate-$rel. 
- Release number will increas by new git snapshot.

* Tue Nov 12 2013 Mosaab Alzoubi <moceap@hotmail.com> - 0.1.git20131112-1
- After more 6 years in 0.0, GnuLib 0.1 released.
- Replace version method to $ver.git$gitdate instead of $gitdate.git$githead.
- Update to 0.1.git20131112.

* Fri Nov 1 2013 Mosaab Alzoubi <moceap@hotmail.com> - 20131030.git5c508f6-2
- Decrease description of git-merge-changelog
- Add license file to git-merge-changelog

* Wed Oct 30 2013 Mosaab Alzoubi <moceap@hotmail.com> - 20131030.git5c508f6-1
- Update to 20131030.git5c508f6
- Create -core noarch package, because rpmbuild can't drive arched subpackage from nonarched main one.
- Some General Fixes.
- Add 1st sample form - Module Sample: (Alpha Version)
- Add 1st module single package - git-merge-changelog

* Mon Oct 28 2013 Mosaab Alzoubi <moceap@hotmail.com> - 20131027.git5191b35-2
- Fixes after Zbigniew Jędrzejewski-Szmek revision:
- Remove prebuilt java class.
- gnulib-docs require gnulib.
- List all licenses.
- Replace define by global.

* Sun Oct 27 2013 Mosaab Alzoubi <moceap@hotmail.com> - 20131027.git5191b35-1
- Update.

* Sat Oct 26 2013 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 20131022.git25fb29a-4
- Spec file tweaks.
- Package MODULES.html.

* Thu Oct 24 2013 Mosaab Alzoubi <moceap@hotmail.com> - 20131022.git25fb29a-3
- Many Fixes.

* Thu Oct 24 2013 Mosaab Alzoubi <moceap@hotmail.com> - 20131022.git25fb29a-2
- Many Fixes.

* Tue Oct 22 2013 Mosaab Alzoubi <moceap@hotmail.com> - 20131022.git25fb29a-1
- Initial build.