diff --git a/.gitignore b/.gitignore index 05ef856..d7d45ca 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ tabbed-0.2.tar.gz +/tabbed-0.6.tar.gz +/tabbed-0.7.tar.gz diff --git a/sources b/sources index 09305e0..5c7e79b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -fc00ee1a9fd1478561b064cd6a53d494 tabbed-0.2.tar.gz +SHA512 (tabbed-0.7.tar.gz) = 770420935fd152e10bef59e29eeb8125ee181993691c6c5f03baf311bd685c2b5f0ded13854b3715cc60d0f1ae99eceacd3e6cb7e4008c34917ae55c38b436a7 diff --git a/tabbed-user b/tabbed-user new file mode 100644 index 0000000..46636ca --- /dev/null +++ b/tabbed-user @@ -0,0 +1,93 @@ +#!/bin/sh +# MIT/X Consortium License +# +# 2014 Petr Šabata +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# + +tool=tabbed +name=${tool}-user +version=VERSION +release=RELEASE +bindir=~/.${tool} +builddir=~/.${tool}-build +sources=/usr/src/${name}-${version}-${release} +config=${bindir}/config.h +modified=${bindir}/modified +buildver=${bindir}/version +patches=${bindir}/patches +patchmod=0 + +function run_custom { + echo "${name}: Running user ${tool}..." 1>&2 + ${bindir}/${tool} $@ +} + +function run_system { + echo "${name}: Running system ${tool}..." 1>&2 + /usr/bin/${tool}-fedora $@ +} + +function rebuild { + if [ ! -d ${sources} ]; then + echo "${name}: Cannot find sources in ${sources}. Not rebuilding." 1>&2 + else + echo "${name}: Rebuilding ${tool}..." 1>&2 + rm -rf ${builddir} + cp -R ${sources} ${builddir} + [ -f ${config} ] && cp ${config} ${builddir}/config.h + cd ${builddir} + if [ -d ${patches} ]; then + echo "${name}: Applying patches to ${tool}..." 1>&2 + find ${patches} -type f -name '*.diff' | sort | xargs -n1 patch -p1 -i + fi + make 2>&1 > ${builddir}/build.log + if [ "$?" -ne 0 ]; then + echo "${name}: Build failed. See ${builddir}/build.log for details." 1>&2 + else + echo "${name}: Build OK." 1>&2 + mv ${builddir}/${tool} ${bindir} + cd $HOME + rm -rf ${builddir} + echo $(stat -c %Y "${bindir}/${tool}") > ${modified} + echo "${version}-${release}" > ${buildver} + fi + fi +} + +mkdir -p ${bindir} +if [ -f ${config} -o -d ${patches} ]; then + if [ -d ${patches} ]; then + patchmod=$(find ${patches} -type f -name '*.diff' -exec stat -c %Y {} \; | sort -r | head -n 1) + if [ "${patchod}" = "" ]; then + patchmod=0 + fi + fi + configmod=$(stat -c %Y ${config}) + if [ "${configmod}" = "" ]; then + configmod=0 + fi + if [ ! -f ${modified} ] || [ "$(cat ${modified})" -lt "${configmod}" ] || + [ "$(cat ${modified})" -lt "${patchmod}" ] || [ ! -f ${buildver} ] || + [ "$(cat ${buildver})" != "${version}-${release}" ] || [ "$1" = '-f' ]; then + rebuild + fi +fi +[ -x ${bindir}/${tool} ] && run_custom $@ || run_system $@ diff --git a/tabbed-user.1 b/tabbed-user.1 new file mode 100644 index 0000000..46c53e6 --- /dev/null +++ b/tabbed-user.1 @@ -0,0 +1,54 @@ +.TH TABBED\-USER 1 tabbed\-user\-VERSION\-RELEASE +.SH NAME +tabbed\-user \- tabbed reconfiguration helper and launcher script +.SH SYNOPSIS +.B tabbed\-user +.SH DESCRIPTION +.BR tabbed\-user +is a helper script for running and reconfiguring +.BR tabbed +if neccessarry. +.P +Running +.BR tabbed\-user +starts the Fedora build by default. If you wish to customize your +configuration, put your +.BR tabbed +configuration header file to $HOME/.tabbed/config.h and adjust it according to +your needs. The official Fedora configuration file might be a useful template. +See the +.BR FILES +section of this manual. +.P +Every time the user configuration file has changed or new patches have +been added, +.BR tabbed\-user +will rebuild the user +.BR tabbed +binary prior to its execution. +.P +Fedora utilizes +.BR alternatives +to choose whether the system build, also installed as +.BR tabbed\-fedora , +or the custom build is run. If available, custom builds are preferred. +.SH FILES +.nf +$HOME/.tabbed + - User tabbed directory +$HOME/.tabbed/config.h + - User tabbed configuration +$HOME/.tabbed/patches + - Optional patches to apply +/usr/src/tabbed\-user\-VERSION\-RELEASE + - tabbed sources +/usr/src/tabbed\-VERSION\-RELEASE/config.def.h + - Fedora build configuration +.fi +.SH SEE ALSO +.BR tabbed (1) , +.BR update-alternatives (8) +.SH BUGS +Report bugs to Red Hat Bugzilla, http://bugzilla.redhat.com/ +.SH AUTHOR +Written by Petr Šabata , 2014. diff --git a/tabbed.spec b/tabbed.spec index 7a9b0a1..1b54fc5 100644 --- a/tabbed.spec +++ b/tabbed.spec @@ -1,56 +1,227 @@ +# XXX: Drop once f36 goes EOL +%if 0%{?fedora} == 036 +%undefine _package_note_file +%endif + Name: tabbed -Version: 0.2 -Release: 6%{?dist} +Version: 0.7 +Release: 7%{?dist} Summary: Simple Xembed container manager -Group: User Interface/X +%global _tabbedsourcedir %{_usrsrc}/tabbed-user-%{version}-%{release} + License: MIT URL: http://tools.suckless.org/tabbed Source0: http://dl.suckless.org/tools/%{name}-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - +Source1: %{name}-user +Source2: %{name}-user.1 +# Upstream tarball doesn't include the xembed manpage in 0.6; taken from +# the git repository (fixed in 910e67db). +Source3: xembed.1 +BuildRequires: binutils +BuildRequires: coreutils +BuildRequires: fontconfig-devel +BuildRequires: gcc BuildRequires: libX11-devel +BuildRequires: libXft-devel +BuildRequires: make +BuildRequires: sed +Requires(post): %{_sbindir}/update-alternatives +Requires(postun): %{_sbindir}/update-alternatives %description -tabbed is a simple generic fronted to xembed aware applications +A simple generic fronted to XEmbed aware applications. +%package user +Summary: Tabbed sources and tools for user configuration +License: MIT +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: binutils +Requires: coreutils +Requires: findutils +Requires: fontconfig-devel +Requires: gcc +Requires: libX11-devel +Requires: libXft-devel +Requires: make +Requires: patch +Requires: redhat-rpm-config +Requires: sed +Requires(post): %{_sbindir}/update-alternatives +Requires(postun): %{_sbindir}/update-alternatives + +%description user +Tabbed source files and a launcher/builder wrapper script for +customized configurations. %prep %setup -q - +# XXX: To be dropped with 0.8+ +cp %{SOURCE3} . sed -e 's|/usr/local|%{_prefix}|g' \ -e 's|/usr/lib|%{_libdir}|g' \ - -e 's|-s ${LIBS}|-g ${LIBS}|g' \ - -e 's|-std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}|%{optflags} ${INCS} ${CPPFLAGS}|g' \ + -e 's|-std=c99 -pedantic -Wall -Os|%{optflags}|g' \ + -e 's|-s\b||' \ + -e 's|\(${LIBS}\)|\1 %{?__global_ldflags}|' \ -i config.mk - sed -i 's!^\(\t\+\)@!\1!' Makefile - %build make %{?_smp_mflags} - %install -rm -rf %{buildroot} -make install \ - DESTDIR=%{buildroot} \ - INSTALL="install -p" +make install DESTDIR=%{buildroot} +mv %{buildroot}%{_bindir}/%{name}{,-fedora} +install -pm755 %{SOURCE1} %{buildroot}%{_bindir}/%{name}-user +install -Dpm644 %{SOURCE2} %{buildroot}%{_mandir}/man1/%{name}-user.1 +for file in \ + %{buildroot}%{_bindir}/%{name}-user \ + %{buildroot}%{_mandir}/man1/%{name}-user.1; do +sed -i -e 's/VERSION/%{version}/' \ + -e 's/RELEASE/%{release}/' \ + ${file} +done +mkdir -p %{buildroot}%{_tabbedsourcedir} +install -m644 arg.h config.def.h config.mk Makefile tabbed.c xembed.c \ + %{buildroot}%{_tabbedsourcedir} +touch %{buildroot}%{_bindir}/%{name} +%pre +[ -L %{_bindir}/%{name} ] || rm -f %{_bindir}/%{name} -%clean -rm -rf %{buildroot} +%post +%{_sbindir}/update-alternatives --install %{_bindir}/%{name} %{name} \ + %{_bindir}/%{name}-fedora 10 +%postun +if [ $1 -eq 0 ] ; then + %{_sbindir}/update-alternatives --remove %{name} %{_bindir}/%{name}-fedora +fi + +%post user +%{_sbindir}/update-alternatives --install %{_bindir}/%{name} %{name} \ + %{_bindir}/%{name}-user 20 + +%postun user +if [ $1 -eq 0 ] ; then + %{_sbindir}/update-alternatives --remove %{name} %{_bindir}/%{name}-user +fi %files -%defattr(-,root,root,-) -%doc LICENSE -%{_bindir}/%{name} +%doc LICENSE README +%ghost %{_bindir}/%{name} +%{_bindir}/%{name}-fedora +%{_bindir}/xembed %{_mandir}/man1/%{name}.* +%{_mandir}/man1/xembed.* +%files user +%ghost %{_bindir}/%{name} +%{_bindir}/%{name}-user +%{_mandir}/man1/%{name}-user.* +%{_tabbedsourcedir} %changelog +* Fri Jul 25 2025 Fedora Release Engineering - 0.7-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Sun Jan 19 2025 Fedora Release Engineering - 0.7-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Sat Jul 20 2024 Fedora Release Engineering - 0.7-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Sat Jan 27 2024 Fedora Release Engineering - 0.7-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sat Jul 22 2023 Fedora Release Engineering - 0.7-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Sat Jan 21 2023 Fedora Release Engineering - 0.7-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Mon Jan 16 2023 Petr Šabata - 0.7-1 +- 0.7 bump +- Now includes the xembed utility; as xembed has no implicit support for + config.def, this release doesn't include xembed customization via the user + subpackage; however, this could be improved in the future +- Adding a temporary workaround for F36 builds +- SPDX migration + +* Sat Jul 23 2022 Fedora Release Engineering - 0.6-22 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Sat Jan 22 2022 Fedora Release Engineering - 0.6-21 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Jul 23 2021 Fedora Release Engineering - 0.6-20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Wed Jan 27 2021 Fedora Release Engineering - 0.6-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Jul 29 2020 Fedora Release Engineering - 0.6-18 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Fri Jan 31 2020 Fedora Release Engineering - 0.6-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Sat Jul 27 2019 Fedora Release Engineering - 0.6-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sun Feb 03 2019 Fedora Release Engineering - 0.6-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Sat Jul 14 2018 Fedora Release Engineering - 0.6-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Fri Feb 09 2018 Fedora Release Engineering - 0.6-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Aug 03 2017 Fedora Release Engineering - 0.6-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 0.6-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 0.6-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Fri Aug 12 2016 Petr Šabata - 0.6-9 +- The user subpackage now properly requires redhat-rpm-config + +* Fri Feb 05 2016 Fedora Release Engineering - 0.6-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Thu Sep 17 2015 Petr Šabata - 0.6-7 +- Enable full RELRO +- Correct the dep list + +* Fri Jun 19 2015 Fedora Release Engineering - 0.6-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Mon Aug 18 2014 Fedora Release Engineering - 0.6-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Wed Aug 13 2014 Petr Šabata - 0.6-4 +- Pass command line parameters to respective binaries in tabbed-user (#1129582) + +* Wed Jun 25 2014 Petr Šabata - 0.6-3 +- Introduce the `user' subpackage + +* Sun Jun 08 2014 Fedora Release Engineering - 0.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Wed Jan 22 2014 Petr Šabata - 0.6-1 +- Bumping to 0.6 +- Adding README and TODO to %%doc +- Dropping the unneeded constructs +- Tweaking the description a little bit + +* Sun Aug 04 2013 Fedora Release Engineering - 0.2-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + * Fri Feb 15 2013 Fedora Release Engineering - 0.2-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild diff --git a/xembed.1 b/xembed.1 new file mode 100644 index 0000000..5b0c28c --- /dev/null +++ b/xembed.1 @@ -0,0 +1,35 @@ +.TH XEMBED 1 tabbed\-VERSION +.SH NAME +xembed \- XEmbed foreground process +.SH SYNOPSIS +.B xembed +.I flag command +.RI [ "argument ..." ] +.SH DESCRIPTION +If the environment variable XEMBED is set, and +.B xembed +is in the foreground of its controlling tty, it will execute +.IP +command flag $XEMBED [argument ...] +.LP +Otherwise it will execute +.IP +command [argument ...] +.LP +.SH EXAMPLE +In a terminal emulator within a +.B tabbed +session, the shell alias +.IP +$ alias surf='xembed -e surf' +.LP +will cause `surf' to open in a new tab, unless it is run in the background, +i.e. `surf &', in which case it will instead open in a new window. +.SH AUTHORS +See the LICENSE file for the authors. +.SH LICENSE +See the LICENSE file for the terms of redistribution. +.SH SEE ALSO +.BR tabbed (1) +.SH BUGS +Please report them.