Skip to content

Commit 71c012f

Browse files
committed
rm systemd files from buildroot before packaging, give up on figuring out correct termios defines
1 parent 672a586 commit 71c012f

File tree

3 files changed

+220
-98
lines changed

3 files changed

+220
-98
lines changed
Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
--- tdnf-3.1.5-orig/tools/cli/lib/output.c 2021-10-06 18:39:26.000000000 +0000
2-
+++ tdnf-3.1.5/tools/cli/lib/output.c 2021-11-17 21:14:29.710175680 +0000
3-
@@ -20,6 +20,7 @@
4-
*/
2+
+++ tdnf-3.1.5/tools/cli/lib/output.c 2021-11-21 21:47:50.156623360 +0000
3+
@@ -21,6 +21,17 @@
54

65
#include "includes.h"
7-
+#include <sys/termios.h>
86

7+
+#ifdef __sgi
8+
+struct winsize {
9+
+ unsigned short ws_row; /* rows, in characters*/
10+
+ unsigned short ws_col; /* columns, in character */
11+
+ unsigned short ws_xpixel; /* horizontal size, pixels */
12+
+ unsigned short ws_ypixel; /* vertical size, pixels */
13+
+};
14+
+
15+
+#define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */
16+
+#endif
17+
+
918
void
1019
ShowConsoleProps(
20+
void

packages/tdnf/SOURCES/latest.patch

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
diff -Nur tdnf-3.1.5-orig/CMakeLists.txt tdnf-3.1.5/CMakeLists.txt
2+
--- tdnf-3.1.5-orig/CMakeLists.txt 2021-10-06 18:39:26.000000000 +0000
3+
+++ tdnf-3.1.5/CMakeLists.txt 2021-11-21 21:46:20.081393280 +0000
4+
@@ -29,13 +29,13 @@
5+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
6+
7+
# Ensure that we don't accidentally install into /usr/etc
8+
-set(CMAKE_INSTALL_FULL_SYSCONDIR "/etc")
9+
-set(SYSCONFDIR /etc)
10+
-
11+
-set(MOTGEN_DIR /etc/motdgen.d)
12+
+set(CMAKE_INSTALL_FULL_SYSCONDIR "/usr/sgug/etc")
13+
+set(SYSCONFDIR /usr/sgug/etc)
14+
15+
+set(MOTGEN_DIR /usr/sgug/etc/motdgen.d)
16+
+
17+
if(NOT SYSTEMD_DIR)
18+
- set(SYSTEMD_DIR /lib/systemd/system)
19+
+ set(SYSTEMD_DIR /usr/sgug/lib/systemd/system)
20+
endif()
21+
22+
23+
diff -Nur tdnf-3.1.5-orig/CMakeLists.txt.rej tdnf-3.1.5/CMakeLists.txt.rej
24+
--- tdnf-3.1.5-orig/CMakeLists.txt.rej 2021-11-17 20:25:37.163415120 +0000
25+
+++ tdnf-3.1.5/CMakeLists.txt.rej 1969-12-31 19:00:00.000000000 +0000
26+
@@ -1,20 +0,0 @@
27+
---- CMakeLists.txt 2021-10-06 18:39:26.000000000 +0000
28+
-+++ CMakeLists.txt 2021-11-17 20:24:04.261990240 +0000
29+
-@@ -29,13 +29,13 @@
30+
- set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
31+
-
32+
- # Ensure that we don't accidentally install into /usr/etc
33+
--set(CMAKE_INSTALL_FULL_SYSCONDIR "/etc")
34+
--set(SYSCONFDIR /etc)
35+
-+set(CMAKE_INSTALL_FULL_SYSCONDIR "/usr/sgug/etc")
36+
-+set(SYSCONFDIR /usr/sgug/etc)
37+
-
38+
--set(MOTGEN_DIR /etc/motdgen.d)
39+
-+set(MOTGEN_DIR /usr/sgug/etc/motdgen.d)
40+
-
41+
- if(NOT SYSTEMD_DIR)
42+
-- set(SYSTEMD_DIR /lib/systemd/system)
43+
-+ set(SYSTEMD_DIR /usr/sgug/lib/systemd/system)
44+
-
45+
-
46+
-
47+
diff -Nur tdnf-3.1.5-orig/client/defines.h tdnf-3.1.5/client/defines.h
48+
--- tdnf-3.1.5-orig/client/defines.h 2021-10-06 18:39:26.000000000 +0000
49+
+++ tdnf-3.1.5/client/defines.h 2021-11-21 21:46:20.122920800 +0000
50+
@@ -59,7 +59,7 @@
51+
52+
//Repo defines
53+
#define TDNF_REPO_EXT ".repo"
54+
-#define TDNF_CONF_FILE "/etc/tdnf/tdnf.conf"
55+
+#define TDNF_CONF_FILE "/usr/sgug/etc/tdnf/tdnf.conf"
56+
#define TDNF_CONF_GROUP "main"
57+
//Conf file key names
58+
#define TDNF_CONF_KEY_GPGCHECK "gpgcheck"
59+
@@ -110,10 +110,10 @@
60+
#define TDNF_REPO_BASEURL_FILE_NAME "baseurl"
61+
62+
// repo defaults
63+
-#define TDNF_DEFAULT_REPO_LOCATION "/etc/yum.repos.d"
64+
-#define TDNF_DEFAULT_CACHE_LOCATION "/var/cache/tdnf"
65+
-#define TDNF_DEFAULT_DISTROVERPKG "system-release"
66+
-#define TDNF_DEFAULT_DISTROARCHPKG "x86_64"
67+
+#define TDNF_DEFAULT_REPO_LOCATION "/usr/sgug/etc/yum.repos.d"
68+
+#define TDNF_DEFAULT_CACHE_LOCATION "/usr/sgug/var/cache/tdnf"
69+
+#define TDNF_DEFAULT_DISTROVERPKG "sgugrse-release"
70+
+#define TDNF_DEFAULT_DISTROARCHPKG "mips"
71+
#define TDNF_RPM_CACHE_DIR_NAME "rpms"
72+
#define TDNF_REPODATA_DIR_NAME "repodata"
73+
#define TDNF_SOLVCACHE_DIR_NAME "solvcache"
74+
@@ -140,7 +140,7 @@
75+
/* plugin defines */
76+
#define TDNF_DEFAULT_PLUGINS_ENABLED 0
77+
#define TDNF_DEFAULT_PLUGIN_PATH SYSTEM_LIBDIR"/tdnf-plugins"
78+
-#define TDNF_DEFAULT_PLUGIN_CONF_PATH "/etc/tdnf/pluginconf.d"
79+
+#define TDNF_DEFAULT_PLUGIN_CONF_PATH "/usr/sgug/etc/tdnf/pluginconf.d"
80+
#define TDNF_PLUGIN_CONF_EXT ".conf"
81+
#define TDNF_PLUGIN_CONF_EXT_LEN 5
82+
#define TDNF_PLUGIN_CONF_MAIN_SECTION "main"
83+
diff -Nur tdnf-3.1.5-orig/client/utils.c tdnf-3.1.5/client/utils.c
84+
--- tdnf-3.1.5-orig/client/utils.c 2021-10-06 18:39:26.000000000 +0000
85+
+++ tdnf-3.1.5/client/utils.c 2021-11-21 21:46:20.229391920 +0000
86+
@@ -509,24 +509,7 @@
87+
)
88+
{
89+
uint32_t dwError = 0;
90+
- char* pszArch = NULL;
91+
- struct utsname stUtsName;
92+
-
93+
- if(!ppszArch)
94+
- {
95+
- dwError = ERROR_TDNF_INVALID_PARAMETER;
96+
- BAIL_ON_TDNF_ERROR(dwError);
97+
- }
98+
- if(uname(&stUtsName) != 0)
99+
- {
100+
- dwError = errno;
101+
- }
102+
- BAIL_ON_TDNF_SYSTEM_ERROR(dwError);
103+
-
104+
- dwError = TDNFAllocateString(stUtsName.machine, &pszArch);
105+
- BAIL_ON_TDNF_ERROR(dwError);
106+
-
107+
- *ppszArch = pszArch;
108+
+ *ppszArch = strdup("mips");
109+
110+
cleanup:
111+
return dwError;
112+
@@ -536,7 +519,6 @@
113+
{
114+
*ppszArch = NULL;
115+
}
116+
- TDNF_SAFE_FREE_MEMORY(pszArch);
117+
goto cleanup;
118+
}
119+
120+
diff -Nur tdnf-3.1.5-orig/common/utils.c tdnf-3.1.5/common/utils.c
121+
--- tdnf-3.1.5-orig/common/utils.c 2021-10-06 18:39:26.000000000 +0000
122+
+++ tdnf-3.1.5/common/utils.c 2021-11-21 21:46:20.263560000 +0000
123+
@@ -586,6 +586,10 @@
124+
dwError = TDNFAllocateMemory(1, strlen(pszPath) + 1, (void **)&pszNormalPath);
125+
BAIL_ON_TDNF_ERROR(dwError);
126+
127+
+#if defined(__sgi)
128+
+ *ppszNormalPath = strdup(pszPath);
129+
+ return dwError;
130+
+#endif
131+
q = pszNormalPath;
132+
133+
while(*p)
134+
diff -Nur tdnf-3.1.5-orig/etc/tdnf/tdnf.conf tdnf-3.1.5/etc/tdnf/tdnf.conf
135+
--- tdnf-3.1.5-orig/etc/tdnf/tdnf.conf 2021-10-06 18:39:26.000000000 +0000
136+
+++ tdnf-3.1.5/etc/tdnf/tdnf.conf 2021-11-21 21:46:20.160430560 +0000
137+
@@ -2,5 +2,5 @@
138+
gpgcheck=1
139+
installonly_limit=3
140+
clean_requirements_on_remove=true
141+
-repodir=/etc/yum.repos.d
142+
-cachedir=/var/cache/tdnf
143+
+repodir=/usr/sgug/etc/yum.repos.d
144+
+cachedir=/usr/sgug/var/cache/tdnf
145+
diff -Nur tdnf-3.1.5-orig/solv/tdnfpool.c tdnf-3.1.5/solv/tdnfpool.c
146+
--- tdnf-3.1.5-orig/solv/tdnfpool.c 2021-10-06 18:39:26.000000000 +0000
147+
+++ tdnf-3.1.5/solv/tdnfpool.c 2021-11-21 21:46:20.190429680 +0000
148+
@@ -106,7 +106,7 @@
149+
BAIL_ON_TDNF_LIBSOLV_ERROR(dwError);
150+
}
151+
152+
- pool_setarch(pPool, systemInfo.machine);
153+
+ pool_setarch(pPool, strdup("mips"));
154+
pool_set_flag(pPool, POOL_FLAG_ADDFILEPROVIDESFILTERED, 1);
155+
156+
dwError = SolvReadInstalledRpms(pPool, &pRepo, pszCacheDir);
157+
diff -Nur tdnf-3.1.5-orig/tools/cli/lib/output.c tdnf-3.1.5/tools/cli/lib/output.c
158+
--- tdnf-3.1.5-orig/tools/cli/lib/output.c 2021-10-06 18:39:26.000000000 +0000
159+
+++ tdnf-3.1.5/tools/cli/lib/output.c 2021-11-21 21:48:05.330564560 +0000
160+
@@ -21,6 +21,17 @@
161+
162+
#include "includes.h"
163+
164+
+#ifdef __sgi
165+
+struct winsize {
166+
+ unsigned short ws_row; /* rows, in characters*/
167+
+ unsigned short ws_col; /* columns, in character */
168+
+ unsigned short ws_xpixel; /* horizontal size, pixels */
169+
+ unsigned short ws_ypixel; /* vertical size, pixels */
170+
+};
171+
+
172+
+#define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */
173+
+#endif
174+
+
175+
void
176+
ShowConsoleProps(
177+
void
178+
diff -Nur tdnf-3.1.5-orig/tools/cli/lib/output.c.rej tdnf-3.1.5/tools/cli/lib/output.c.rej
179+
--- tdnf-3.1.5-orig/tools/cli/lib/output.c.rej 1969-12-31 19:00:00.000000000 +0000
180+
+++ tdnf-3.1.5/tools/cli/lib/output.c.rej 2021-11-21 21:46:20.303872400 +0000
181+
@@ -0,0 +1,20 @@
182+
+--- tools/cli/lib/output.c 2021-10-06 18:39:26.000000000 +0000
183+
++++ tools/cli/lib/output.c 2021-11-21 21:45:37.803940800 +0000
184+
+@@ -21,6 +21,17 @@
185+
+
186+
+ #include "includes.h"
187+
+
188+
++#ifdef __sgi
189+
++struct winsize {
190+
++ unsigned short ws_row; /* rows, in characters*/
191+
++ unsigned short ws_col; /* columns, in character */
192+
++ unsigned short ws_xpixel; /* horizontal size, pixels */
193+
++ unsigned short ws_ypixel; /* vertical size, pixels */
194+
++};
195+
++
196+
++#define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */
197+
++#endif
198+
++
199+
+ void
200+
+ ShowConsoleProps(
201+
+

packages/tdnf/SPECS/tdnf.spec

Lines changed: 5 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Patch106: cli-termios.sgifixes.patch
2525
# Patch107: tdnf-printfprecision.sgifixes.patch
2626

2727
Requires: rpm-libs
28-
Requires: curl-libs
28+
Requires: libcurl
2929
Requires: tdnf-cli-libs = %{version}-%{release}
3030
Requires: libsolv
3131
Requires: libmetalink
@@ -50,7 +50,7 @@ BuildRequires: python3-devel
5050
# BuildRequires: libxml2
5151
# %endif
5252

53-
Obsoletes: yum
53+
# Obsoletes: yum
5454
Provides: yum
5555

5656
%description
@@ -143,93 +143,13 @@ ln -sf %{_bindir}/tdnf %{buildroot}%{_bindir}/yum
143143
mv %{buildroot}%{_libdir}/pkgconfig/tdnfcli.pc %{buildroot}%{_libdir}/pkgconfig/tdnf-cli-libs.pc
144144
mkdir -p %{buildroot}/%{_tdnfpluginsdir}/tdnfrepogpgcheck
145145
mv %{buildroot}/%{_tdnfpluginsdir}/libtdnfrepogpgcheck.so %{buildroot}/%{_tdnfpluginsdir}/tdnfrepogpgcheck/libtdnfrepogpgcheck.so
146-
mv %{buildroot}/lib/systemd/system/ %{buildroot}/%{_libdir}/systemd/
146+
rm -rf %{buildroot}%{_prefix}/lib/systemd/system/
147147

148-
pushd python
148+
cd python
149149
python3 setup.py install --skip-build --prefix=%{_prefix} --root=%{buildroot}
150-
popd
150+
cd ..
151151
find %{buildroot} -name '*.pyc' -delete
152152

153-
# # Pre-install
154-
# %pre
155-
156-
# # First argument is 1 => New Installation
157-
# # First argument is 2 => Upgrade
158-
159-
# # Post-install
160-
# %post
161-
162-
# # First argument is 1 => New Installation
163-
# # First argument is 2 => Upgrade
164-
165-
# /sbin/ldconfig
166-
167-
# %triggerin -- motd
168-
# [ $2 -eq 1 ] || exit 0
169-
# if [ $1 -eq 1 ]; then
170-
# echo "detected install of tdnf/motd, enabling tdnf-cache-updateinfo.timer" >&2
171-
# systemctl enable tdnf-cache-updateinfo.timer >/dev/null 2>&1 || :
172-
# systemctl start tdnf-cache-updateinfo.timer >/dev/null 2>&1 || :
173-
# elif [ $1 -eq 2 ]; then
174-
# echo "detected upgrade of tdnf, daemon-reload" >&2
175-
# systemctl daemon-reload >/dev/null 2>&1 || :
176-
# fi
177-
178-
# # Pre-uninstall
179-
# %preun
180-
181-
# # First argument is 0 => Uninstall
182-
# # First argument is 1 => Upgrade
183-
184-
# %triggerun -- motd
185-
# [ $1 -eq 1 ] && [ $2 -eq 1 ] && exit 0
186-
# echo "detected uninstall of tdnf/motd, disabling tdnf-cache-updateinfo.timer" >&2
187-
# systemctl --no-reload disable tdnf-cache-updateinfo.timer >/dev/null 2>&1 || :
188-
# systemctl stop tdnf-cache-updateinfo.timer >/dev/null 2>&1 || :
189-
# rm -rf /var/cache/tdnf/cached-updateinfo.txt
190-
191-
# Post-uninstall
192-
# %postun
193-
194-
# /sbin/ldconfig
195-
196-
# # First argument is 0 => Uninstall
197-
# # First argument is 1 => Upgrade
198-
199-
# %triggerpostun -- motd
200-
# [ $1 -eq 1 ] && [ $2 -eq 1 ] || exit 0
201-
# echo "detected upgrade of tdnf/motd, restarting tdnf-cache-updateinfo.timer" >&2
202-
# systemctl try-restart tdnf-cache-updateinfo.timer >/dev/null 2>&1 || :
203-
204-
# %post cli-libs
205-
206-
# # First argument is 1 => New Installation
207-
# # First argument is 2 => Upgrade
208-
209-
# /sbin/ldconfig
210-
211-
# %postun cli-libs
212-
213-
# /sbin/ldconfig
214-
215-
# # First argument is 0 => Uninstall
216-
# # First argument is 1 => Upgrade
217-
218-
# %post automatic
219-
# %systemd_post %{name}-automatic.timer
220-
# %systemd_post %{name}-automatic-notifyonly.timer
221-
# %systemd_post %{name}-automatic-install.timer
222-
223-
# %preun automatic
224-
# %systemd_preun %{name}-automatic.timer
225-
# %systemd_preun %{name}-automatic-notifyonly.timer
226-
# %systemd_preun %{name}-automatic-install.timer
227-
228-
# %postun automatic
229-
# %systemd_postun_with_restart %{name}-automatic.timer
230-
# %systemd_postun_with_restart %{name}-automatic-notifyonly.timer
231-
# %systemd_postun_with_restart %{name}-automatic-install.timer
232-
233153
%files
234154
%defattr(-,root,root,0755)
235155
%{_bindir}/tdnf
@@ -238,8 +158,6 @@ find %{buildroot} -name '*.pyc' -delete
238158
%{_bindir}/tdnf-cache-updateinfo
239159
%{_libdir}/libtdnf.so.*
240160
%config(noreplace) %{_sysconfdir}/tdnf/tdnf.conf
241-
%config %{_libdir}/systemd/system/tdnf-cache-updateinfo.service
242-
%config(noreplace) %{_libdir}/systemd/system/tdnf-cache-updateinfo.timer
243161
%config %{_sysconfdir}/motdgen.d/02-tdnf-updateinfo.sh
244162
%dir %{_prefix}/var/cache/tdnf
245163
%{_datadir}/bash-completion/completions/tdnf
@@ -249,7 +167,6 @@ find %{buildroot} -name '*.pyc' -delete
249167
%{_includedir}/tdnf/*.h
250168
%{_libdir}/libtdnf.so
251169
%{_libdir}/libtdnfcli.so
252-
%exclude %{_libdir}/debug
253170
%{_libdir}/pkgconfig/tdnf.pc
254171
%{_libdir}/pkgconfig/tdnf-cli-libs.pc
255172

@@ -271,12 +188,6 @@ find %{buildroot} -name '*.pyc' -delete
271188
%defattr(-,root,root,0755)
272189
%{_bindir}/%{name}-automatic
273190
%config(noreplace) %{_sysconfdir}/%{name}/automatic.conf
274-
%{_libdir}/systemd/system/%{name}-automatic.timer
275-
%{_libdir}/systemd/system/%{name}-automatic.service
276-
%{_libdir}/systemd/system/%{name}-automatic-install.timer
277-
%{_libdir}/systemd/system/%{name}-automatic-install.service
278-
%{_libdir}/systemd/system/%{name}-automatic-notifyonly.timer
279-
%{_libdir}/systemd/system/%{name}-automatic-notifyonly.service
280191

281192
%changelog
282193
* Wed Nov 17 2021 David Stancu <dstancu@nyu.edu> - 3.1.5-2

0 commit comments

Comments
 (0)