You are not logged in.
Pages: 1
Im wanting to have a try at creating .deb for the slstatus package but not sure how.
Could i just git clone slstatus and use dh_make from there or would be better off downloading the tar?
I successfully created a .deb of a shell script but a git repo is a bit daunting, is there any good tutorials for this type of build?
Edit: Ive read the f'ing manual but still confused im stuck at debian/rules
dh_usrlocal: debian/slstatus/usr/local/bin/slstatus is not a directory
make: *** [debian/rules:18: binary] Error 25
dpkg-buildpackage: error: fakeroot debian/rules binary subprocess returned exit status 2
debuild: fatal error at line 1182:
dpkg-buildpackage -us -uc -ui failed
Last edited by dice (2021-04-15 10:16:21)
Offline
Whenever I get stuck like this I create the directories... and re-run the command.
use
locate debian/slstatus/usr/local/bin/slstatus
work your way back from there...
create directory...
mkdir debian/slstatus/usr/local/bin/slstatus
See if that helps. Sometimes it's a permission to write by the program.
see how you go.
pic from 1993, new guitar day.
Offline
"is there any good tutorials", Nope
There is like no tutes on writing a deb that I can find.
To me it's looking for a directory to include in the deb.
dh_usrlocal: debian/slstatus/usr/local/bin/slstatus is not a directory
I'd say you need to add in your rules file to create it
mkdir -vp debian/slstatus/usr/local/bin
/usr/local/bin/slstatus only makes sense to me as a program, not a directory
Good luck
It's a matter of play to get it working
Offline
Thanks for the hints. Figured it out somewhat from dwm apt source.
slstatus-1.0/debian/rules
#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
SHELL := sh -e
%:
dh ${@}
override_dh_auto_clean:
rm -f config.h
$(MAKE) clean
override_dh_auto_install:
$(MAKE) install DESTDIR=$(CURDIR)/debian/slstatus PREFIX=/usr
mv debian/slstatus/usr/bin/slstatus debian/slstatus/usr/bin/slstatus.default
ln -s slstatus.1.gz debian/slstatus/usr/share/man/man1/slstatus.default.1.gz
Last edited by dice (2021-04-15 12:47:19)
Offline
The best way to create .deb packages is with the debmake command.
any good tutorials
Have you seen https://www.debian.org/doc/manuals/debmake-doc/?
I made a package for slstatus a while ago, here's a link to my debian directory tarball: https://download.opensuse.org/repositor … ian.tar.xz
ln -s slstatus.1.gz debian/slstatus/usr/share/man/man1/slstatus.default.1.gz
Was the man page not installed automatically by dh_installman(1)?
EDIT: corrected download link.
Last edited by Head_on_a_Stick (2021-04-15 13:52:10)
Brianna Ghey — Rest In Power
Offline
The best way to create .deb packages is with the debmake command.
dice wrote:any good tutorials
Have you seen https://www.debian.org/doc/manuals/debmake-doc/?
I made a package for slstatus a while ago, here's a link to my debian directory tarball: https://download.opensuse.org/repositor … ian.tar.xz
dice wrote:ln -s slstatus.1.gz debian/slstatus/usr/share/man/man1/slstatus.default.1.gz
Was the man page not installed automatically by dh_installman(1)?
EDIT: corrected download link.
Thanks.
I fear any package for slstatus will be mostly personal via source, but its good to have a binary for easy installation. What features does your package have as default settings?
The default debian/rules were not enough to successfully build the deb so i borrowed the rules from apt source dwm and modified to suit. It would have picked up man page with dh_installman i suppose.
Offline
What features does your package have as default settings?
I cut the guts out of the suckless original, here's my de-commented config.def.h:
const unsigned int interval = 1000;
static const char unknown_str[] = "n/a";
#define MAXLEN 2048
static const struct arg args[] = {
{ load_avg, " %s • ", NULL },
{ battery_perc, "%s", "BAT0" },
{ datetime, "%s", "% • %F • %T" },
};
I also removed the unwanted components and associated lines in the Makefile.
The resultant binary is tiny:
-rwxr-xr-x 1 root root 22656 May 12 2019 /usr/bin/slstatus
But the memory usage is about the same as a (dash) shell script:
268.0 KiB + 338.0 KiB = 606.0 KiB status
240.0 KiB + 392.0 KiB = 632.0 KiB slstatus
*shrugs*
Brianna Ghey — Rest In Power
Offline
ive got volume via dev/mixer and cpu temp which bumps my settings up somewhat.
-rwxr-xr-x 1 root root 31784 Apr 15 22:14 /usr/bin/slstatus
static const struct arg args[] = {
/* function format argument */
{ vol_perc, " V: %s % | ", "/dev/mixer" },
{ run_command, " C: %s | " , "/home/dice/bin/temp" },
{ battery_perc, "B: %2s %% | ", "BAT1" },
{ datetime, "T: %s", "%R" },
};
Offline
Did you remove the unwanted stuff from the components directory and delete the lines relating to them in the Makefile? That reduces the size of the binary considerably.
Brianna Ghey — Rest In Power
Offline
Did you remove the unwanted stuff from the components directory and delete the lines relating to them in the Makefile? That reduces the size of the binary considerably.
so just delete the components not needed in the Makefile as well?
wouldnt deleting the lines in the makefile be enough?
eg;
REQ = util
COM =\
components/battery\
components/cpu\
components/datetime\
components/disk\
components/entropy\
components/hostname\
components/ip\
components/kernel_release\
components/keyboard_indicators\
components/keymap\
components/load_avg\
components/netspeeds\
components/num_files\
components/ram\
components/run_command\
components/separator\
components/swap\
components/temperature\
components/uptime\
components/user\
components/volume\
components/wifi
Last edited by dice (2021-04-15 15:01:52)
Offline
Yes, that's right.
Here's mine:
COM =\
components/battery\
components/datetime\
components/load_avg
I also cut up the load_avg component so that it only displays the first value (from the last minute)
Brianna Ghey — Rest In Power
Offline
Yes, that's right.
Here's mine:
COM =\ components/battery\ components/datetime\ components/load_avg
I also cut up the load_avg component so that it only displays the first value (from the last minute)
Got it down to this.
-rwxr-xr-x 1 root root 23336 Apr 15 22:14 /usr/bin/slstatus
REQ = util
COM =\
components/battery\
components/datetime\
components/run_command\
components/volume\
Thanks for the tips.
Last edited by dice (2021-04-15 15:15:04)
Offline
Pages: 1