2da3cef22ba48a100895dcc825947f27eb96c8cf
[services/obs-service-git-buildpackage.git] / packaging / obs-service-git-buildpackage.spec
1 # Set to 0 if "normal release"
2 %define pre_release 1
3
4 %if 0%{?pre_release}
5 %define release_prefix 0pre%{pre_release}.
6 %endif
7
8 Name:           obs-service-git-buildpackage
9 License:        GPL-2.0+
10 Group:          Development/Tools/Building
11 Summary:        Get sources from a repository managed with the git-buildpackage suite
12 Version:        0.7
13 Release:        %{?release_prefix}%{?opensuse_bs:<CI_CNT>.<B_CNT>}%{!?opensuse_bs:1}
14 URL:            http://www.tizen.org
15 Source:         %{name}-%{version}.tar.bz2
16 Requires:       git-buildpackage
17 Requires:       git-buildpackage-rpm
18 Requires:       gbp-repocache = %{version}-%{release}
19 BuildRequires:  python
20 BuildRequires:  python-setuptools
21 %if 0%{?do_unittests}
22 BuildRequires:  python-coverage
23 BuildRequires:  python-nose
24 BuildRequires:  git-buildpackage-rpm
25 %endif
26 BuildArch:      noarch
27
28 %description
29 This is a source service for openSUSE Build Service.
30
31 It supports cloning/updating repo from git and exporting sources and packaging
32 files that are managed with git-buildpackage tools.
33
34
35 %package utils
36 Summary:    Utility fuctions for the GBP OBS source service
37 Group:      Development/Tools/Building
38 Requires:   python >= 2.6
39 Requires:   gbp-repocache = %{version}
40
41 %description utils
42 This package contains generic utility functions for the git-buildpackage OBS
43 source service.
44
45
46 %package -n gbp-repocache
47 Summary:    Git repository cache API
48 Group:      Development/Tools/Building
49 Requires:   git-buildpackage-common
50
51 %description -n gbp-repocache
52 This package provides an implementation and python API of a Git repository
53 cache.
54
55
56 %prep
57 %setup
58
59
60 %build
61 %{__python} setup.py build
62
63
64 %if 0%{?do_unittests}
65 %check
66 GIT_AUTHOR_EMAIL=rpmbuild@example.com GIT_AUTHOR_NAME=rpmbuild \
67     GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL \
68     %{__python} setup.py nosetests
69 %endif
70
71
72 %install
73 %{__python} setup.py install --skip-build --root=%{buildroot} --prefix=%{_prefix}
74 rm -rf %{buildroot}%{python_sitelib}/*info
75
76
77 %files
78 %defattr(-,root,root,-)
79 %doc COPYING DEPLOYMENT
80 %dir /usr/lib/obs
81 %dir /usr/lib/obs/service
82 /usr/lib/obs/service/*
83 %{python_sitelib}/obs_service_gbp
84 %dir %{_sysconfdir}/obs
85 %dir %{_sysconfdir}/obs/services
86 %config %{_sysconfdir}/obs/services/*
87
88 %files utils
89 %defattr(-,root,root,-)
90 %doc COPYING
91 %{python_sitelib}/obs_service_gbp_utils
92
93 %files -n gbp-repocache
94 %defattr(-,root,root,-)
95 %doc COPYING
96 %{python_sitelib}/gbp_repocache