Browse code

update tdnf to 1.2.2, add createrepo_c, obsolete yum, createrepo

Change-Id: If2a2b6e912182cca51927aa85d8f79b2ab363abd
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/3967
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Anish Swaminathan <anishs@vmware.com>
Reviewed-by: Alexey Makhalov <amakhalov@vmware.com>

Priyesh Padmavilasom authored on 2017/10/05 17:39:28
Showing 4 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,73 @@
0
+Summary: 	Creates a common metadata repository
1
+Name: 		createrepo_c
2
+Version: 	0.10.0
3
+Release: 	1%{?dist}
4
+License:	GPLv2+
5
+Group: 		System Environment/Base
6
+Vendor:		VMware, Inc.
7
+Distribution: 	Photon
8
+Source0: 	%{name}-%{version}.tar.gz
9
+%define sha1 createrepo_c=b2333b490575cf1199d78ca1945c5808f41c6440
10
+URL: 		https://github.com/rpm-software-management/createrepo_c
11
+BuildRequires:  cmake
12
+BuildRequires:  curl-devel
13
+BuildRequires:  expat-devel
14
+BuildRequires:  file-devel
15
+BuildRequires:  glib-devel
16
+BuildRequires:  libffi-devel
17
+BuildRequires:  libxml2-devel
18
+BuildRequires:  rpm-devel
19
+BuildRequires:  xz-devel
20
+BuildRequires:  sqlite-devel
21
+Obsoletes:      createrepo
22
+Provides:       createrepo
23
+
24
+%description
25
+C implementation of the createrepo.
26
+
27
+%package devel
28
+Summary:    Library for repodata manipulation
29
+Requires:   %{name} = %{version}-%{release}
30
+
31
+%description devel
32
+headers and libraries for createrepo_c
33
+
34
+%prep
35
+%setup -q
36
+sed -e '/find_package(GTHREAD2/ s/^#*/#/' -i CMakeLists.txt
37
+sed -i 's|g_thread_init|//g_thread_init|'  src/createrepo_c.c
38
+sed -i 's|g_thread_init|//g_thread_init|'  src/mergerepo_c.c
39
+sed -i 's|g_thread_init|//g_thread_init|'  src/modifyrepo_c.c
40
+sed -i 's|g_thread_init|//g_thread_init|'  src/sqliterepo_c.c
41
+
42
+%build
43
+mkdir build && cd build
44
+cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ..
45
+make %{?_smp_mflags}
46
+
47
+%install
48
+cd build
49
+make install DESTDIR=%{buildroot}
50
+ln -sf %{_bindir}/createrepo_c %{buildroot}%{_bindir}/createrepo
51
+
52
+%clean
53
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
54
+
55
+
56
+%files
57
+%defattr(-, root, root)
58
+/etc/bash_completion.d/createrepo_c.bash
59
+%{_bindir}/*
60
+%{_lib64dir}/*.so.*
61
+%{_mandir}/*
62
+%exclude %{_libdir}/python*
63
+
64
+%files devel
65
+%defattr(-, root, root)
66
+%{_includedir}/*
67
+%{_lib64dir}/*.so
68
+%{_lib64dir}/pkgconfig/%{name}.pc
69
+
70
+%changelog
71
+* Wed Oct 04 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 0.10.0-1
72
+- Initial
... ...
@@ -3,8 +3,8 @@
3 3
 #
4 4
 Summary:        dnf/yum equivalent using C libs
5 5
 Name:           tdnf
6
-Version:        1.2.1
7
-Release:        5%{?dist}
6
+Version:        1.2.2
7
+Release:        1%{?dist}
8 8
 Vendor:         VMware, Inc.
9 9
 Distribution:   Photon
10 10
 License:        LGPLv2.1,GPLv2
... ...
@@ -19,18 +19,18 @@ BuildRequires:  hawkey-devel >= 2017.1
19 19
 BuildRequires:  openssl-devel
20 20
 BuildRequires:  libsolv-devel
21 21
 BuildRequires:  curl-devel
22
-Source0:    %{name}-%{version}.tar.gz
23
-Patch0:     tdnf_quiet_repo_refresh.patch
24
-Patch1:     tdnf_report_problems_to_stderr.patch
25
-%define sha1 tdnf=ebbed639c68316e5a152b0bd277c1b040ee6871f
26
-Source1:    cache-updateinfo
27
-Source2:    cache-updateinfo.service
28
-Source3:    cache-updateinfo.timer
29
-Source4:    updateinfo.sh
22
+Obsoletes:      yum
23
+Provides:       yum
24
+Source0:        %{name}-%{version}.tar.gz
25
+%define sha1    tdnf=51e084e294e1ae4eae800dbf6f4e435c3d18a8ff
26
+Source1:        cache-updateinfo
27
+Source2:        cache-updateinfo.service
28
+Source3:        cache-updateinfo.timer
29
+Source4:        updateinfo.sh
30 30
 
31 31
 %description
32 32
 tdnf is a yum/dnf equivalent
33
-which uses libhawkey and librepo
33
+which uses libsolv and libhawkey
34 34
 
35 35
 %package    devel
36 36
 Summary:    A Library providing C API for tdnf
... ...
@@ -50,12 +50,10 @@ Library providing cli libs for tdnf like clients.
50 50
 
51 51
 %prep
52 52
 %setup -q
53
-%patch0 -p1
54
-%patch1 -p1
55 53
 
56 54
 
57 55
 %build
58
-sed -i 's/tdnf, 1.2.0/tdnf, 1.2.1/' configure.ac
56
+sed -i 's/tdnf, 1.2.0/tdnf, 1.2.2/' configure.ac
59 57
 autoreconf -i
60 58
 ./configure \
61 59
     --prefix=%{_prefix} \
... ...
@@ -70,6 +68,7 @@ make DESTDIR=%{buildroot} install
70 70
 find %{buildroot} -name '*.la' -delete
71 71
 mkdir -p %{buildroot}/var/cache/tdnf
72 72
 ln -sf %{_bindir}/tdnf %{buildroot}%{_bindir}/tyum
73
+ln -sf %{_bindir}/tdnf %{buildroot}%{_bindir}/yum
73 74
 install -v -D -m 0755 %{SOURCE1} %{buildroot}%{_bindir}/tdnf-cache-updateinfo
74 75
 install -v -D -m 0644 %{SOURCE2} %{buildroot}%{_libdir}/systemd/system/tdnf-cache-updateinfo.service
75 76
 install -v -D -m 0644 %{SOURCE3} %{buildroot}%{_libdir}/systemd/system/tdnf-cache-updateinfo.timer
... ...
@@ -131,6 +130,7 @@ systemctl try-restart tdnf-cache-updateinfo.timer >/dev/null 2>&1 || :
131 131
     %defattr(-,root,root,0755)
132 132
     %{_bindir}/tdnf
133 133
     %{_bindir}/tyum
134
+    %{_bindir}/yum
134 135
     %{_bindir}/tdnf-cache-updateinfo
135 136
     %{_libdir}/*.so.*
136 137
     %config(noreplace) %{_sysconfdir}/tdnf/tdnf.conf
... ...
@@ -152,6 +152,8 @@ systemctl try-restart tdnf-cache-updateinfo.timer >/dev/null 2>&1 || :
152 152
     %{_libdir}/libtdnfcli.so.*
153 153
 
154 154
 %changelog
155
+*   Wed Oct 4 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.2.2-1
156
+-   update to v1.2.2
155 157
 *   Sat Sep 30 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.2.1-5
156 158
 -   Output problems while resolving to stderr (instead of stdout)
157 159
 *   Wed Sep 27 2017 Bo Gan <ganb@vmware.com> 1.2.1-4
158 160
deleted file mode 100644
... ...
@@ -1,33 +0,0 @@
1
-diff --git a/client/init.c b/client/init.c
2
-index b7e88ff..417b995 100644
3
-+++ b/client/init.c
4
-@@ -284,9 +284,12 @@ TDNFRefreshRepo(
5
- 
6
-     if(nCleanMetadata || nMetadataExpired)
7
-     {
8
--        fprintf(stdout,
9
--                "Refreshing metadata for: '%s'\n",
10
--                pRepo->pszName);
11
-+        if(!pTdnf->pArgs->nQuiet)
12
-+        {
13
-+            fprintf(stdout,
14
-+                    "Refreshing metadata for: '%s'\n",
15
-+                    pRepo->pszName);
16
-+        }
17
-         dwError = TDNFRepoRemoveCache(pTdnf, pRepo->pszId);
18
-         if(dwError == ERROR_TDNF_FILE_NOT_FOUND)
19
-         {
20
-diff --git a/client/remoterepo.c b/client/remoterepo.c
21
-index 12b4d2d..946aafd 100644
22
-+++ b/client/remoterepo.c
23
-@@ -137,7 +137,7 @@ TDNFDownloadFile(
24
-     dwError = curl_easy_setopt(pCurl, CURLOPT_FOLLOWLOCATION, 1L);
25
-     BAIL_ON_TDNF_CURL_ERROR(dwError);
26
- 
27
--    if(pszProgressData)
28
-+    if(!pTdnf->pArgs->nQuiet && pszProgressData)
29
-     {
30
-         dwError = set_progress_cb(pCurl, pszProgressData);
31
-         BAIL_ON_TDNF_ERROR(dwError);
32 1
deleted file mode 100644
... ...
@@ -1,18 +0,0 @@
1
-diff --git a/client/goal.c b/client/goal.c
2
-index bad589e..54d29a5 100644
3
-+++ b/client/goal.c
4
-@@ -329,11 +329,11 @@ TDNFGoalReportProblems(
5
-     nCount = hy_goal_count_problems(hGoal);
6
-     if(nCount > 0)
7
-     {
8
--        fprintf(stdout, "Found %d problem(s) while resolving\n", nCount);
9
-+        fprintf(stderr, "Found %d problem(s) while resolving\n", nCount);
10
-         for(; i < nCount; ++i)
11
-         {
12
-             pszProblem = hy_goal_describe_problem(hGoal, i);
13
--            fprintf(stdout, "%d. %s\n", i+1, pszProblem);
14
-+            fprintf(stderr, "%d. %s\n", i+1, pszProblem);
15
- 
16
-             hy_free(pszProblem);
17
-             pszProblem = NULL;