What must I do to have stow
only linking the binaries (and maybe the man pages) correctly?
I want to use GNU stow
to manage local installs on my machine. However, stow
does not simply symlinks the binary, but all files in the program folder.
What I did so far:
- created an extended stow-ignore file
- use a subfolder
src/
where all files except the binary go and manually change the Makefile to create abin/
subfolder. Then later delete the linkedlocal/src/
folder
I guess there must be a better way and I am using stow
wrong.
Example
Folder structure
~home/
|~local/
|+bin/ <-- binarys should go here
|+share/ <-- man page
|~stow/
|-.stowrc
|~dwm-6.0/
|-Makefile
|-dwm.c
|-dwm.h
|-dwm
|-config.mk
|-README
|~hub-1.11/
|~bin/
|-hub
|+etc/
|+feature/
|+githook/
|+lib/
|-Gemfile
|-Rakefile
|-hub.gemspec
From here I would go into the stow/
folder type
stow dwm-6.0
Then stow links all files into the local/
folder, instead of only the binary dwm
into the local/bin/
folder. I can now change the Makefile
so it creates a dwm-6.0/bin/
folder and moves the binary in there. Then stow
at least will link dwm
to local/bin/
, but still all other files are linked to local/
as well.
The same goes for hub
:
[9962]../stow:$stow hub-1.11.1
Loading defaults from .stowrc
stow dir is /home/myusername/local/stow
stow dir path relative to target /home/myusername/local is stow
Planning stow of package hub-1.11.1...
LINK: man => stow/hub-1.11.1/man
LINK: test => stow/hub-1.11.1/test
LINK: hub.gemspec => stow/hub-1.11.1/hub.gemspec
LINK: script => stow/hub-1.11.1/script
LINK: etc => stow/hub-1.11.1/etc
LINK: lib => stow/hub-1.11.1/lib
LINK: hub => stow/hub-1.11.1/hub
LINK: bin/hub => ../stow/hub-1.11.1/bin/hub
LINK: git-hooks => stow/hub-1.11.1/git-hooks
LINK: Rakefile => stow/hub-1.11.1/Rakefile
LINK: Gemfile => stow/hub-1.11.1/Gemfile
LINK: features => stow/hub-1.11.1/features
Planning stow of package hub-1.11.1... done
Processing tasks...
Processing tasks... done
Now stow
even links the man
files to a separate folder instead of using share/
===
.stow-global-ignore
# Comments and blank lines are allowed.
RCS
.+,v
CVS
\.\#.+ # CVS conflict files / emacs lock files
\.cvsignore
\.svn
_darcs
\.hg
\.git
\.gitignore
.+~ # emacs backup files
\#.*\# # emacs autosave files
.*\.c # c src files
.*\.cc # c++ src files
#.*\.\d # compile temporary files
#.*\.\d\..* # compile temporary files
.*\.o # object files
.*\.h # include files
.*\.info
.*\.mk # make configs
.*\.swp # vim temp buffer file
.*\.lock # vim temp buffer file
.*\.md # mark down
.*\.yml # YAML
#.*\.gemspec # gem file
#.*\.rb # ruby file
#.*\.sh # shell file
#.*\.feature # shell file
README.*
LICENSE
FAQ
LEGACY
TODO
Makefile
.stowrc
--dir=/home/myusername/local/stow
--target=/home/myusername/local
^((?!(\/)bin|include|lib|lib64|local|sbin|share|tmp).)*$
will stow "only" those (bin,include etc..) directories