Blob Blame Raw
#%global _dwz_low_mem_die_limit 0
%global debug_package   %{nil}
%global provider        github
%global provider_tld    com
%global project        	ingvagabund
%global repo            gofed
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
%global cmdsignature_commit 33207573a1875bc828da3f863e1de439d7af8166
%global cmdsignature_shortcommit %(c=%{cmdsignature_commit}; echo ${c:0:7})
%global gofedlib_commit c2e5b00ebc01616820e571aa554429b1461dc2c4
%global gofedlib_shortcommit %(c=%{gofedlib_commit}; echo ${c:0:7})
%global gofedresources_commit 7e414c78930a81167dc2cd4d3e9adb79eeed38a6
%global gofedresources_shortcommit %(c=%{gofedresources_commit}; echo ${c:0:7})
%global gofedinfra_commit 6bff7ae54535689e2ade3d0bd3d33d903a2190b9
%global gofedinfra_shortcommit %(c=%{gofedinfra_commit}; echo ${c:0:7})
%global commit 48d80fe18e643be7bd3ebc6ece22a6a07bb188d1
%global shortcommit     %(c=%{commit}; echo ${c:0:7})
%global cmdsignature_repo cmdsignature
%global gofedlib_repo gofedlib
%global gofedresources_repo resources
%global gofedinfra_repo infra
%if ! 0%{?gobuild:1}
%define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**}; 
Name:		gofed
Version:	1.0.0
Release:	0.15.rc1%{?dist}
Summary:	Tool for development of golang devel packages
License:	GPLv2+
Patch0:         set-correct-paths.patch
# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required
ExclusiveArch:  %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
ExcludeArch: ppc64
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
BuildRequires:  python >= 2.7.5
BuildRequires:  python-devel
BuildRequires:  python-setuptools
Requires: python >= 2.7.5, bash, wget, rpmdevtools, rpmlint
Requires: coreutils, rpm-build, openssh-clients, tar
Requires: %{name}-cmd-dnfs-base = %{version}-%{release}
Requires: python-cmdsignature = %{version}-%{release}
Requires: %{name}-infra = %{version}-%{release}
Requires: %{name}-base = %{version}-%{release}
Requires: bash-completion
Conflicts: gofed < 1.0.0
Tool to automize packaging of golang devel source codes.
The main goal is to automatize packaging, i.e. provide spec file generators,
discovery of tests, imported and provided packages,
check of up-to-date state of dependencies,
preparation of review and
check of spec file (gofed lint).
%package cmd-dnfs-base
Summary: Set of basic commands definitions
BuildArch: noarch
%description cmd-dnfs-base
Basic gofed commands definition
%package cmd-dnfs-build
Summary: Set of build commands definitions
BuildArch: noarch
%description cmd-dnfs-build
Build gofed commands definition
%package cmd-dnfs-scan
Summary: Set of scan commands definitions
BuildArch: noarch
%description cmd-dnfs-scan
Scan gofed commands definition
%package base
Summary: Implementation of base commands for gofed
BuildArch: noarch
%description base
Basic commands
%package scan
Summary: Set of commands for scanning golang projects
Requires: %{name} = %{version}-%{release}
Requires: %{name}-cmd-dnfs-scan = %{version}-%{release}
Requires: python-cmdsignature = %{version}-%{release}
Requires: graphviz
BuildArch: noarch
Conflicts: gofed-scan < 1.0.0
%description scan
Subpackage providing commands for scanning of golang project, i.e.
comparison of APIs of two golang projects,
generator of xml files representing exported symbols and
scan of golang packages and generator of dependency graph.
%package build
Summary: Set of commands for building golang projects
Requires: %{name} = %{version}-%{release}
Requires: %{name}-cmd-dnfs-build = %{version}-%{release}
Requires: python-cmdsignature = %{version}-%{release}
BuildArch: noarch
Conflicts: gofed-build < 1.0.0
%description build
Subpackage providing commands for scratch builds, builds,
pulls, pushes, updates, overrides and other commands
that can be used for package maitainance.
The commands support running one command on multiple branches at once.
%package gofedlib
Summary: Gofedlib
BuildRequires: python-fedora python-jinja2 python-markupsafe python2-koji
Requires: python-fedora python-jinja2 python-markupsafe python2-pygithub python2-hglib
%description gofedlib
%package resources
Summary: Gofed resources
BuildRequires: python2-hglib
Requires: python2-hglib
Requires: %{name}-gofedlib = %{version}-%{release}
BuildArch: noarch
%description resources
Gofed resources
%package infra
Summary: Gofed infra
BuildRequires: python-jsonschema koji GitPython python-pycurl python2-hglib python-gitdb
Requires: python-jsonschema koji GitPython python-pycurl python2-hglib python-gitdb
Requires: %{name}-gofedlib = %{version}-%{release}
Requires: %{name}-resources = %{version}-%{release}
BuildArch: noarch
%description infra
Gofed infra
%package docker
Summary: Run gofed commands as a container
Requires: %{name}-cmd-dnfs-base = %{version}-%{release}
Requires: python-cmdsignature = %{version}-%{release}
Requires: docker
BuildArch: noarch
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ppc64le s390x %{mips}
%description docker
Run gofed commands as a container
%package -n python2-cmdsignature
Summary: Command signature python module
BuildArch: noarch
BuildRequires: PyYAML
Requires: python >= 2.7.5
Requires: PyYAML
%{?python_provide:%python_provide python2-cmdsignature}
%description -n python2-cmdsignature
Command signature python module
%setup -q -n %{cmdsignature_repo}-%{cmdsignature_commit} -T -b 1
%setup -q -n %{gofedlib_repo}-%{gofedlib_commit} -T -b 2
%setup -q -n %{gofedresources_repo}-%{gofedresources_commit} -T -b 3
%setup -q -n %{gofedinfra_repo}-%{gofedinfra_commit} -T -b 4
%setup -q -n %{repo}-%{commit}
%patch0 -p1
sed -i -e '1c #!%{__python2}' gofed gofed-docker
sed -i -e '1{\@^#!@d}' cmd/unit-test/
pushd ../%{cmdsignature_repo}-%{cmdsignature_commit}
%{__python2} build
pushd ../%{gofedlib_repo}-%{gofedlib_commit}
pushd gofedlib/go/symbolsextractor
%gobuild -o parseGo parseGo.go
%{__python2} build
pushd ../%{gofedresources_repo}-%{gofedresources_commit}
%{__python2} build
pushd ../%{gofedinfra_repo}-%{gofedinfra_commit}
%{__python2} build
# install cmdsignature as standard python module
pushd ../%{cmdsignature_repo}-%{cmdsignature_commit}
%{__python2} install --skip-build --root %{buildroot}
pushd ../%{gofedlib_repo}-%{gofedlib_commit}
%{__python2} install --skip-build --root %{buildroot}
pushd ../%{gofedresources_repo}-%{gofedresources_commit}
%{__python2} install --skip-build --root %{buildroot}
pushd ../%{gofedinfra_repo}-%{gofedinfra_commit}
%{__python2} install --skip-build --root %{buildroot}
# copy command definitions under gofed-cmd-dnf-[base|build|scan]
mkdir -p %{buildroot}%{_datadir}/%{name}/
cp -rpav cmd %{buildroot}%{_datadir}/%{name}/.
cp -pav *.py %{buildroot}%{_datadir}/%{name}/.
# install binaries
install -m 755 -d %{buildroot}/%{_bindir}
cp -pav gofed %{buildroot}%{_bindir}/gofed
cp -pav gofed-docker %{buildroot}%{_bindir}/gofed-docker
# TODO: generate bash completion via cmdsignature
# TODO: generate man pages via cmdsignature
cp -r modules %{buildroot}%{_datadir}/%{name}/.
# copy config
mkdir -p %{buildroot}%{_sysconfdir}
cp -av config/gofed.conf %{buildroot}%{_sysconfdir}/.
mkdir -p %{buildroot}%{_datadir}/%{name}/config
cp -av config/gofed.conf %{buildroot}%{_datadir}/%{name}/config/.
# directory for local database
install -m 755 -d %{buildroot}/%{_sharedstatedir}/%{name}
# copy golang list and native imports
cp -r data %{buildroot}%{_sharedstatedir}/%{name}/.
# working directory under /var/lib/gofed
install -m 775 -d %{buildroot}/%{_sharedstatedir}/%{name}/resource_provider
install -m 775 -d %{buildroot}/%{_sharedstatedir}/%{name}/resource_client
install -m 775 -d %{buildroot}/%{_sharedstatedir}/%{name}/storage
install -m 775 -d %{buildroot}/%{_sharedstatedir}/%{name}/simplefilestorage
# man pages
mkdir -p %{buildroot}%{_mandir}/man1
cp -av docs/gofed.1 %{buildroot}%{_mandir}/man1/gofed.1
export PYTHONPATH=%{buildroot}/%{python2_sitelib}:%{buildroot}%{_datadir}/gofed:%{buildroot}%{_datadir}
rm $(find %{buildroot}%{_datadir}/%{name} -iname "*.py[c|o]")
rm -r %{buildroot}%{_datadir}/%{name}/config
getent group gofed >/dev/null || groupadd -r gofed
getent passwd gofed >/dev/null || useradd -r -g gofed -d / -s /sbin/nologin \
        -c "Gofed user" gofed
%files cmd-dnfs-base
%files cmd-dnfs-build
%files cmd-dnfs-scan
%files base
%files build
%files scan
%files gofedlib
%license LICENSE 
%files resources
%license LICENSE 
%files infra
%license LICENSE 
%files -n python2-cmdsignature
%license LICENSE 
%files docker
%license LICENSE
%doc *.md
%config(noreplace) %{_sysconfdir}/gofed.conf
%attr(-, gofed, gofed) %{_sharedstatedir}/%{name}
* Sun Dec 17 2017 Zbigniew Jędrzejewski-Szmek <> - 1.0.0-0.15.rc1
- python-cmdsignature binary package is renamed to python2-cmdsignature
* Tue Nov 07 2017 Igor Gnatenko <> - 1.0.0-0.14.rc1
- Fix issues in packaging
* Mon Sep 18 2017 Jan Chaloupka <> - 1.0.0-0.13.rc1
- python-PyGithub renamed to python2-pygithub
  resolves: #1492244
* Wed Aug 02 2017 Fedora Release Engineering <> - 1.0.0-0.12.rc1
- Rebuilt for
* Wed Jul 26 2017 Fedora Release Engineering <> - 1.0.0-0.11.rc1
- Rebuilt for
* Mon Jun 26 2017 Jan Chaloupka <> - 1.0.0-0.10.rc1
- Exclude ppc64 architecture (missing docker rpm)
  resolves: #1465019
* Wed Mar 01 2017 Jan Chaloupka <> - 1.0.0-0.9.rc1
- Provide a simple man page
  resolves: #1426854
* Fri Feb 10 2017 Fedora Release Engineering <> - 1.0.0-0.8.rc1
- Rebuilt for
* Wed Jan 25 2017 Jan Chaloupka <> - 1.0.0-0.7.rc1
- Bump to a7766e5587800fc3b49c46149605cd95a98eb31b
  resolves: #1416407
* Tue Dec 27 2016 Fabio Alessandro Locati <> - 1.0.0-0.6.rc1
- Compile the docker one only for supported arches
* Tue Oct 04 2016 jchaloup <> - 1.0.0-0.5.rc1
- create missing directories under /var/lib/gofed
* Fri Sep 23 2016 jchaloup <> - 1.0.0-0.4.rc1
- extend the list of known deps directories with vendor (upstream #117)
* Thu Sep 22 2016 jchaloup <> - 1.0.0-0.3.rc1
- Add missing deps, minor fixes
* Wed Sep 21 2016 jchaloup <> - 1.0.0-0.2.rc1
- Bump deps, conflict with older gofed
* Sun Sep 18 2016 jchaloup <> - 1.0.0-0.rc1.1
- Update to gofed infrastructure
* Thu Jul 21 2016 Fedora Release Engineering <> - 0.0.10-5
* Wed Apr 06 2016 jchaloup <> - 0.0.10-4
- Define gobuild macro if not defined (for other distros without go-srpm-macros)
* Mon Feb 22 2016 Fedora Release Engineering <> - 0.0.10-3
* Wed Feb 03 2016 Fedora Release Engineering <> - 0.0.10-2
- Rebuilt for
* Wed Nov 18 2015 jchaloup <> - 0.0.10-1
- Update to 0.0.10
* Thu Sep 17 2015 jchaloup <> - 0.0.9-3
- Bump to upstream 04cd8f0c083e3e80bbe17fc4acd2192a1628a5be
* Thu Sep 10 2015 jchaloup <> - 0.0.9-2
- Define license macro if not defined
* Thu Sep 10 2015 jchaloup <> - 0.0.9-1
- Updated to version 0.0.9
* Mon Aug 31 2015 jchaloup <> - 0.0.8-3
- Add -d option when copying symlinks. Otherwise symlinks are followed.
* Sat Aug 29 2015 jchaloup <> - 0.0.8-2
- Add missing symlinks
* Fri Aug 21 2015 jchaloup <> - 0.0.8-1
- Updated to version 0.0.8
* Sat Aug 01 2015 jchaloup <> - 0.0.7-1
- Updated to version 0.0.7
* Sat Jul 11 2015 jchaloup <> - 0.0.6-1
- Updated to version 0.0.6
* Tue Jun 23 2015 jchaloup <> - 0.0.5-1
- Updated to version 0.0.5
* Wed Jun 17 2015 Fedora Release Engineering <> - 0.0.4-2
- Rebuilt for
* Tue Jun 09 2015 jchaloup <> - 0.0.4-1
- Update to version 0.0.4
  related: #1204614
* Sat May 09 2015 jchaloup <> - 0.0.3-1
- Update to version 0.0.3
  related: #1204614
* Thu Apr 02 2015 jchaloup <> - 0.0.1-0.1.git62b0051
- Update to version 0.0.1
  related: #1204614
* Mon Mar 23 2015 jchaloup <> - 0-0.1.gitcab0f0b
- Initial commit for Fedora
  resolves: #1204614