From 14b084178853d6d694bb7d94db9cc2d7f9002e6b Mon Sep 17 00:00:00 2001 From: YellowJacketLinux Date: Mon, 21 Oct 2024 23:26:34 -0700 Subject: [PATCH] Progress --- README.md | 54 ++++++-- SPECS/gdb.spec | 96 ++++++++++++++ SPECS/git.spec | 269 +++++++++++++++++++++++++++++++++++++++ SPECS/python3-six.spec | 57 +++++++++ SPECS/python3-wheel.spec | 64 ++++++++++ SPECS/zlib.spec | 25 ++-- 6 files changed, 546 insertions(+), 19 deletions(-) create mode 100644 SPECS/gdb.spec create mode 100644 SPECS/git.spec create mode 100644 SPECS/python3-six.spec create mode 100644 SPECS/python3-wheel.spec diff --git a/README.md b/README.md index e31410d..5749019 100644 --- a/README.md +++ b/README.md @@ -131,21 +131,27 @@ the Chapter 8 build instructions. After packaging [`util-linux`](util-linux) and thus completing the packages in the LFS book through Chapter 7, I decided I needed a change in strategy. -* First, I needed git *inside* the LFS being RPM bootstrapped to reduce howxi - often a reboot is needed, so I built [`openssh`](SPECS/openssh.spec) and + +Intermission Bootstrapping +-------------------------- + +* First, I needed git *inside* the LFS system being RPM bootstrapped to reduce + how often a reboot is needed, so I built [`openssh`](SPECS/openssh.spec) and [`git`](SPECS/git.spec). Fortunately the spec files I had written for my LFS 11.3 RPM system needed very little modification. -* Secondly, I decided it would be good to package `gdb` and `valgrind` now, so - that package test suites that do more extensive testing when those packages - are available can do that testing. -* Thirdly, I need to come up with a so-called "best practices" for RPM spec +* Secondly, I decided it would be good to package [`gdb`](gdb.spec) and + `valgrind` now, so that package test suites that do more + extensive testing when those packages are available can do that testing. +* Thirdly, I need to come up with a so-called ‘best practices’ for RPM spec files that I can use to audit my spec files. +Currently I am working on getting `gdb` and `valgrind` packaged. + Then I can go through the LFS book Chapter 8 in order, even rebuilding the packages I already built so they have the benefit of gdb/valgrind in the test suite and the spec file audit. -### RPM User and Group Dependencies +### Best Practices: RPM User and Group Dependency Notes With new versions of RPM, if a specified file has user and/or group ownership other than `root`, RPM will make the existence of that user and/or group a @@ -158,7 +164,8 @@ though system users and groups being defined in the `/etc/passwd` and With my `util-linux` package, RPM complained about needing `group(tty)` *even though the group exists*. With my `openssh-server` package, RPM again complained about needing `group(sys)` *even though the group exists*. This is just because -those groups are not defined in a systemd-sysusers unit file. In fact the *only*systemd-sysusers file defined is for `dbus` which was installed from source +those groups are not defined in a systemd-sysusers unit file. In fact the *only* +systemd-sysusers file defined is for `dbus` which was installed from source after SystemD was installed. I probably will create the systemd-sysusers unit files for the standard system @@ -171,3 +178,34 @@ of via in the `/etc/rpm/macros` file. That macro affects the *build* of a package, packages built without that macro set to 1 will still have any non-root users and groups defined in the `%files` section as package dependencies. + +Note that with macro, the RPM will still *suggest* a user or group, it just will +not *require* the user or group. + + +LFS Chapter Eight Bootstrap +--------------------------- + +With the so-called ‘best practices’ developed and in hand, I will then package +everything in LFS 12.2 Chapter 8 either auditing existing RPM spec files to +bring them inline with the ‘best practices’ or writing brand new spec files +where I do not currently have them. + +Going through the packages in the Chapter 8 order, any package that has build or +install dependencies RPM does not know about will have to have that dependency +packaged. For example, SQLite3 is not in the LFS book but when present, Python3 +will use it to make a Python module for it, so when I get to Python3, I will +have to build an SQLite3 package if I have not already. + +For the `man-pages` package, LFS packages it first because many of the man pages +in it get replaced by man pages from other packages. I am actually going to +change the install path to `/usr/share/generic-man` to avoid man page conflicts, +and put it at the *end* of the man path so that man pages from that collection +are only presented to the user if not provided by another package. + +The rebuild of GCC in this phase is when I will add the `m2` (GNU Modula-2) +compiler support. + +At this point, I will have a very good base and can go on to RPM bootstrapping +the various BLFS packages (and a few outside of BLF) and then finally build the +RPM package. diff --git a/SPECS/gdb.spec b/SPECS/gdb.spec new file mode 100644 index 0000000..1445c2f --- /dev/null +++ b/SPECS/gdb.spec @@ -0,0 +1,96 @@ +Name: gdb +Version: 15.2 +Release: %{?repo}0.rc1%{?dist} +Summary: GNU Project Debugger + +Group: Development/Utilities +License: GPLv2 GPLv3 LGPLv2 LGPLv3 +URL: https://www.sourceware.org/gdb/ +Source0: https://ftp.gnu.org/gnu/gdb/gdb-%{version}.tar.xz + +BuildRequires: expat-devel +BuildRequires: liblzma-devel +BuildRequires: mpfr-devel +BuildRequires: gmp-devel +BuildRequires: readline-devel +BuildRequires: libzstd-devel +BuildRequires: ncurses-devel +BuildRequires: python3-devel +BuildRequires: elfutils-devel +BuildRequires: libstdc++-devel +BuildRequires: dejagnu +%if %{?python3_ABI:1}%{!?python3_ABI:0} +# Non-Standard Macro +Requires: %{python3_ABI} +%else +Requires: %{python3_sitearch} +%endif +Requires: python3-six + +%description +GDB, the GNU Project debugger, allows you to see what is going on +`inside' another program while it executes -- or what another program +was doing at the moment it crashed. + +%prep +%setup -q + + +%build +mkdir build && cd build +../configure --prefix=%{_prefix} \ + --with-system-readline \ + --with-python=%{python3} +make %{?_smp_mflags} + +# after we have Doxygen +# make -C gdb/doc doxy + +%check +cd build/gdb/testsuite +%if 0%{?runtests:1} == 1 +make site.exp +echo "set gdb_test_timeout 120" >> site.exp +runtest > %{name}-runtest.log 2>&1 ||: +%else +echo "make check not run during packaging" > %{name}-runtest.log +%endif + +%install +cd build +make -C gdb install DESTDIR=%{buildroot} + +# after we have Doxygen +# cp -Rv gdb/doc/doxy /usr/share/doc/gdb-15.2 + +%files +%defattr(-,root,root,-) +%attr(0755,root,root) %{_bindir}/gcore +%attr(0755,root,root) %{_bindir}/gdb +%attr(0755,root,root) %{_bindir}/gdb-add-index +%attr(0755,root,root) %dir %{_includedir}/gdb +%attr(0644,root,root) %{_includedir}/gdb/jit-reader.h +%{_datadir}/gdb +%attr(0644,root,root) %{_infodir}/annotate.info* +%attr(0644,root,root) %{_infodir}/gdb.info* +%attr(0644,root,root) %{_infodir}/stabs.info* +%exclude %{_infodir}/dir +%attr(0644,root,root) %{_mandir}/man1/gcore.1* +%attr(0644,root,root) %{_mandir}/man1/gdb-add-index.1* +%attr(0644,root,root) %{_mandir}/man1/gdb.1* +%attr(0644,root,root) %{_mandir}/man1/gdbserver.1* +%attr(0644,root,root) %{_mandir}/man5/gdbinit.5* +%license COPYING COPYING.LIB COPYING3 COPYING3.LIB +%doc ChangeLog gdb/README COPYING COPYING.LIB COPYING3 COPYING3.LIB +%doc build/gdb/testsuite/%{name}-runtest.log + + +%changelog +* Mon Oct 21 2024 Michael A. Peters - 15.2-0.rc1 +- Build for YJL 6.6 (LFS 12.2) + +* Tue Apr 18 2023 Michael A. Peters - 13.1-0.rc2 +- Fix BuildRequires, tabs to spaces, conditionally run tests. + +* Thu Apr 06 2023 Michael A. Peters - 13.1-0.rc1 +- Initial spec file for YJL (RPM bootstrapping LFS/BLFS 11.3) diff --git a/SPECS/git.spec b/SPECS/git.spec new file mode 100644 index 0000000..0a51014 --- /dev/null +++ b/SPECS/git.spec @@ -0,0 +1,269 @@ +# FIXME - man pages needs put into subpackages + +%global specrel 0.dev3 + +# no stripping +%global debug_package %{nil} +%global __strip /bin/true + +%global gitdocs %{_datadir}/git-documentation + +%if 0%{?!__sed:1} == 1 +%global __sed %{_bindir}/sed} +%endif + +%if 0%{?repo:1} == 1 +%if "%{repo}" == "1.core." +%global novalgrind novalgrind +%global notk notk +%endif +%if "%{repo}" == "2.cli." +%global notk notk +%endif +%endif + +Name: git +Version: 2.47.0 +Release: %{?repo}%{specrel}%{?dist} +Summary: distributed version control system + +Group: Development/Utilities +License: GPL-2.0-only and LGPL-2.1-or-later +URL: https://git-scm.com/ +Source0: https://www.kernel.org/pub/software/scm/git/git-%{version}.tar.xz +Source1: https://www.kernel.org/pub/software/scm/git/git-manpages-%{version}.tar.xz +Source2: https://www.kernel.org/pub/software/scm/git/git-htmldocs-%{version}.tar.xz + +BuildRequires: %{__sed} +BuildRequires: perl-devel +BuildRequires: python3-devel +BuildRequires: libpcre2-devel +BuildRequires: pkgconfig(libcurl) +BuildRequires: pkgconfig(expat) +BuildRequires: pkgconfig(zlib) +%if 0%{?libresslAPI:1} == 1 +BuildRequires: libressl-devel +%else +BuildRequires: pkgconfig(openssl) +%endif +%if 0%{?!notk:1} == 1 +BuildRequires: tk-devel +%endif +%if 0%{?runtests:1} == 1 +%if 0%{?!novalgrind:1} == 1 +BuildRequires: valgrind +%endif +%endif +Requires: curl +Requires: openssh-clients +Requires: perl-Git = %{version}-%{release} + + +%description +Git is a free and open source distributed version control system designed +to handle everything from small to very large projects with speed and +efficiency. + +Git is easy to learn and has a tiny footprint with lightning fast +performance. It outclasses SCM tools like Subversion, CVS, Perforce, +and ClearCase with features like cheap local branching, convenient +staging areas, and multiple workflows. + +%package -n perl-Git +Group: Development/Libraries +Summary: Git Perl modules +BuildArch: noarch +Requires: %{name} = %{version}-%{release} +%if 0%{?perl5_API:1} == 1 +Requires: %{perl5_API} +%endif + +%description -n perl-Git +This package contains the Git perl modules. + +%if 0%{?!notk:1} == 1 +%package gui +Group: Applications/Development +Summary: The Tcl/Tk GUI front-end to git +Requires: %{name} = %{version}-%{release} +BuildRequires: tk-devel +Requires: tk +BuildArch: noarch + +%description gui +This package provides the Tcl/Tk graphical front-end to git. +%endif + +%package documentation +Group: Developer/Documentation +Summary: HTML and Text documentation for git +Requires: %{name} = %{version}-%{release} +BuildArch: noarch + +%description documentation +This package contains the in-depth HTML and Text documentation for git. + +%prep +%setup -q + + +%build +%configure \ + --with-gitconfig=%{_sysconfdir}/gitconfig \ +%if 0%{?notk:1} == 1 + --with-tcltk=no \ +%endif + --with-perl=%{__perl} \ + --with-python=%{python3} +make %{?_smp_mflags} + + +%check +%if 0%{?runtests:1} == 1 +make test > %{name}-make.test.log 2>&1 +%else +echo "make test not run at package build" > %{name}-make.test.log +%endif + +%install +make perllibdir=%{perl5_vendorlib} install DESTDIR=%{buildroot} +install -m644 -D contrib/completion/git-completion.bash \ + %{buildroot}%{_datadir}/bash-completion/completions/git +%find_lang git + +[ ! -d %{buildroot}%{_mandir} ] && mkdir -p %{buildroot}%{_mandir} +tar -xf %{SOURCE1} \ + -C %{buildroot}%{_mandir} --no-same-owner --no-overwrite-dir +mkdir -p %{buildroot}%{gitdocs} +tar -xf %{SOURCE2} \ + -C %{buildroot}%{gitdocs} --no-same-owner --no-overwrite-dir +find %{buildroot}%{gitdocs} -type d -exec chmod 755 {} \; +find %{buildroot}%{gitdocs} -type f -exec chmod 644 {} \; + +# reorganize html docs +mkdir -p %{buildroot}%{gitdocs}/man-pages/{html,text} +mv %{buildroot}%{gitdocs}/{git*.txt,man-pages/text} +mv %{buildroot}%{gitdocs}/{git*.,index.,man-pages/}html +mkdir -p %{buildroot}%{gitdocs}/technical/{html,text} +mv %{buildroot}%{gitdocs}/technical/{*.txt,text} +mv %{buildroot}%{gitdocs}/technical/{*.,}html +mkdir -p %{buildroot}%{gitdocs}/howto/{html,text} +mv %{buildroot}%{gitdocs}/howto/{*.txt,text} +mv %{buildroot}%{gitdocs}/howto/{*.,}html +%__sed -i '/^ - 2.47.0-0.dev3 +- Build for YJL 6.6 (LFS 12.2) + +* Thu May 18 2023 Michael A. Peters - 2.40.1-0.dev2 +- Add bash completion file + +* Sat May 13 2023 Michael A. Peters - 2.40.1-0.dev1 +- Initial spec file for YJL (RPM bootstrapping LFS/BLFS 11.3) diff --git a/SPECS/python3-six.spec b/SPECS/python3-six.spec new file mode 100644 index 0000000..79f7541 --- /dev/null +++ b/SPECS/python3-six.spec @@ -0,0 +1,57 @@ +%global dnlhash 71/39/171f1c67cd00715f190ba0b100d606d440a28c93c7714febeca8b79af85e + +Name: python3-six +Version: 1.16.0 +Release: %{?repo}0.rc1%{?dist} +Summary: Python wheel packaging standard +BuildArch: noarch + +Group: Development/Python +License: MIT +URL: https://github.com/benjaminp/six +Source0: https://files.pythonhosted.org/packages/%{dnlhash}/six-%{version}.tar.gz + +%if 0%{?python3_API:1} == 1 +# Non-Standard Macro +Requires: %{python3_API} +%endif + +%description +Six is a Python 2 and 3 compatibility library. It provides utility functions for +smoothing over the differences between the Python versions with the goal of +writing Python code that is compatible on both Python versions. See the +documentation for more information on what is provided. + +Six supports Python 2.7 and 3.3+. It is contained in only one Python file, so it +can be easily copied into your project. (The copyright and license notice must be +retained.) + + +%prep +%setup -q -n six-%{version} + + +%build +#PYTHONPATH=src %%{__pip3} wheel -w dist --no-build-isolation --no-deps $PWD +CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}" \ +%{python3} setup.py build --executable="%{python3} -s" + + +%install +#DESTDIR=%%{buildroot} %%{__pip3} install --no-index --find-links=dist wheel +CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}" \ +%{python3} setup.py install -O1 --skip-build --root %{buildroot} + + +%files +%defattr(-,root,root,-) +%{python3_sitelib}/six.py +%{python3_sitelib}/six-%{version}-py%{python3_version}.egg-info +%{python3_sitelib}/__pycache__/*.pyc +%license LICENSE +%doc LICENSE README.rst + + +%changelog +* Mon Oct 21 2024 Michael A. Peters - 1.16.0-0.rc1 +- Initial package for YJL 6.6 (LFS 12.2) diff --git a/SPECS/python3-wheel.spec b/SPECS/python3-wheel.spec new file mode 100644 index 0000000..121d07a --- /dev/null +++ b/SPECS/python3-wheel.spec @@ -0,0 +1,64 @@ +%global dnlhash b7/a0/95e9e962c5fd9da11c1e28aa4c0d8210ab277b1ada951d2aee336b505813 + +Name: python3-wheel +Version: 0.44.0 +Release: %{?repo}0.rc1%{?dist} +Summary: Python wheel packaging standard +BuildArch: noarch + +Group: Development/Python +License: MIT +URL: https://github.com/pypa/wheel +Source0: https://files.pythonhosted.org/packages/%{dnlhash}/wheel-%{version}.tar.gz + +%if 0%{?python3_API:1} == 1 +# Non-Standard Macro +Requires: %{python3_API} +%endif + +%description +This library is the reference implementation of the Python wheel packaging +standard, as defined in PEP 427. + +It has two different roles: + +1) A setuptools extension for building wheels that provides the bdist_wheel +setuptools command. + +2) A command line tool for working with wheel files. + +It should be noted that wheel is not intended to be used as a library, +and as such there is no stable, public API. + + +%prep +%setup -q -n wheel-%{version} + + +%build +#PYTHONPATH=src %%{__pip3} wheel -w dist --no-build-isolation --no-deps $PWD +CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}" \ +%{python3} setup.py build --executable="%{python3} -s" + + +%install +#DESTDIR=%%{buildroot} %%{__pip3} install --no-index --find-links=dist wheel +CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}" \ +%{python3} setup.py install -O1 --skip-build --root %{buildroot} + + +%files +%defattr(-,root,root,-) +%attr(0755,root,root) %{_bindir}/wheel +%{python3_sitelib}/wheel +%{python3_sitelib}/wheel-%{version}-py%{python3_version}.egg-info +%license LICENSE.txt +%doc LICENSE.txt README.rst docs + + +%changelog +* Mon Oct 21 2024 Michael A. Peters - 0.44-0.rc1 +- Build for YJL 6.6 (LFS 12.2) + +* Wed May 10 2023 Michael A. Peters - 0.40-0.rc1 +- Initial spec file for YJL (RPM bootstrapping LFS/BLFS 11.3) diff --git a/SPECS/zlib.spec b/SPECS/zlib.spec index c857059..e04ce77 100644 --- a/SPECS/zlib.spec +++ b/SPECS/zlib.spec @@ -2,7 +2,7 @@ Name: zlib Version: 1.3.1 -Release: %{?repo}0.rc1%{?dist} +Release: %{?repo}0.rc3%{?dist} Summary: A compression library Group: System Environment/Libraries @@ -32,8 +32,7 @@ necessary to compile software that links against the zlib library. %build -./configure --prefix=%{_prefix} \ - --libdir=/%{_lib} +./configure --prefix=%{_prefix} make %{?_smp_mflags} %check @@ -41,21 +40,22 @@ make check > %{name}-make.check.log %install make install DESTDIR=%{buildroot} -install -m755 -d %{buildroot}%{_libdir} -sed -i 's?libdir=.*?libdir=%{_libdir}?' %{buildroot}/%{_lib}/pkgconfig/zlib.pc -mv %{buildroot}/%{_lib}/pkgconfig %{buildroot}%{_libdir}/ -rm -f %{buildroot}/%{_lib}/libz.so -ln -s ../../%{_lib}/libz.so.1.2.13 %{buildroot}%{_libdir}/libz.so +#install -m755 -d %{buildroot}%{_libdir} +#sed -i 's?libdir=.*?libdir=%{_libdir}?' %{buildroot}/%{_lib}/pkgconfig/zlib.pc +#sed -i 's?^sharedlibdir=%{_prefix}?sharedlibdir=?' %{buildroot}/%{_lib}/pkgconfig/zlib.pc +#mv %{buildroot}/%{_lib}/pkgconfig %{buildroot}%{_libdir}/ +#rm -f %{buildroot}/%{_lib}/libz.so +#ln -s ../../%{_lib}/libz.so.1.2.13 %{buildroot}%{_libdir}/libz.so # just in case we ever package the static library -mv %{buildroot}/%{_lib}/libz.a %{buildroot}%{_libdir}/ +#mv %{buildroot}/%{_lib}/libz.a %{buildroot}%{_libdir}/ %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %defattr(-,root,root,-) -%attr(0755,root,root) /%{_lib}/libz.so.%{libzsharedv} -/%{_lib}/libz.so.1 +%attr(0755,root,root) %{_libdir}/libz.so.%{libzsharedv} +%{_libdir}/libz.so.1 %license LICENSE %doc ChangeLog LICENSE README FAQ %doc %{name}-make.check.log @@ -71,6 +71,9 @@ mv %{buildroot}/%{_lib}/libz.a %{buildroot}%{_libdir}/ %license LICENSE %changelog +* Mon Oct 21 2024 Michael A. Peters - 1.3.1-0.rc3 +- Don't use /lib for now as it breaks OpenSSH build + * Sun Oct 20 2024 Michael A. Peters - 1.3.1-0.rc1 - Build for YJL 6.6 (LFS 12.2)