linux - symlink not created on the second install of an rpm -


something odd heppaning here . i'm building rpm package , here spec file :

[root@localhost rpmbuild]# cat specs/generated.spec  # name of package name: sotoolkit  # short summary of package summary: toolkit  # version of package version: 1.5  # release number of package release: 1  #url  url: https://github.blah blah blah   # license wish list license: gplv2  # group rpm typically reside in group: development/tools  # packaged rpm packager: me  # build architecture of rpm (noarch/x86_64/i386/etc) buildarch: noarch  # should not need mess setting buildroot: %{_tmppath}/%{name}  # change extension change compression level in rpm #  tar / tar.gz / tar.bz2 source0: %{name}.tar.gz  # if having trouble building package , need disable #  automatic dependency/provides checking, uncomment this: autoreqprov: no  # if package has prerequisites, uncomment line , #  list them here - examples listed #requires: bash, python >= 2.7  # more verbose description of package %description toolkit v.1.5  # not need change %define debug_package %{nil}  %prep %setup -q -c  %build  %install rsync -a . %{buildroot}/ ln -sf /integration/scripts/sotoolkit1.5/start.sh /usr/bin/sotoolkit  %clean rm -rf %{buildroot}  #%pre  #%post  #%preun  %postun unlink /usr/bin/sotoolkit  #%trigger  #%triggerin  #%triggerun  %changelog * tue jul 18 2017 l.popovski <l.pop@blah.com>  - 1.5-1   %files %attr(0644, root, root) "/readme" %attr(0755, root, root) %dir "/integration/scripts/sotoolkit1.5/changelog" %attr(0644, root, root) "/integration/scripts/sotoolkit1.5/changelog/fixes1.5.txt" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/check_if_single_or_multinode.sh" %attr(0755, root, root) %dir "/integration/scripts/sotoolkit1.5/log" %attr(0755, root, root) %dir "/integration/scripts/sotoolkit1.5/multinode" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/multinode/exp" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/multinode/firmware_tools.sh" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/multinode/fm_tools.sh" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/multinode/fs_tools.sh" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/multinode/functions_multi" %attr(0755, root, root) %dir "/integration/scripts/sotoolkit1.5/multinode/log_tools" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/multinode/log_tools.sh" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/multinode/log_tools/collectl_perf.sh" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/multinode/log_tools/crashdump.sh" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/multinode/log_tools/exp" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/multinode/log_tools/timediff.sh" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/multinode/log_tools/vsp_collect.sh" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/multinode/menu.sh" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/multinode/node_tools.sh" %attr(0755, root, root) %dir "/integration/scripts/sotoolkit1.5/multinode/other_tools" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/multinode/other_tools.sh" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/multinode/other_tools/b6200_missing_cluster.sh" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/multinode/other_tools/exp" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/multinode/other_tools/relaxhw.sh" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/multinode/other_tools/syscheck.sh" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/multinode/sset_tools.sh" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/multinode/sys_tools.sh" %attr(0755, root, root) %dir "/integration/scripts/sotoolkit1.5/multinode/tmp" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/replay_last_session.sh" %attr(0755, root, root) %dir "/integration/scripts/sotoolkit1.5/singlenode" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/singlenode/exp" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/singlenode/firmware_tools.sh" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/singlenode/fm_tools.sh" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/singlenode/fs_tools.sh" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/singlenode/functions_single" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/singlenode/guideme.sh" %attr(0755, root, root) %dir "/integration/scripts/sotoolkit1.5/singlenode/log_tools" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/singlenode/log_tools.sh" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/singlenode/log_tools/crashdump.sh" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/singlenode/log_tools/exp" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/singlenode/menu.sh" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/singlenode/node_tools.sh" %attr(0755, root, root) %dir "/integration/scripts/sotoolkit1.5/singlenode/other_tools" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/singlenode/other_tools.sh" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/singlenode/other_tools/exp" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/singlenode/other_tools/relaxhw.sh" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/singlenode/other_tools/syscheck.sh" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/singlenode/sset_tools.sh" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/singlenode/sys_tools.sh" %attr(0755, root, root) %dir "/integration/scripts/sotoolkit1.5/singlenode/tmp" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/sotoolkit.sh" %attr(0755, root, root) "/integration/scripts/sotoolkit1.5/start.sh" %doc readme 

here comes strange thing :

  1. on first install of rpm works fine – symlink being created in /usr/bin
  2. i uninstall tool – works fine again
  3. i try second install , time symlink not being created ! odd !
  4. if rebuild rpm , install again – works fine , uninstall , agan doesn’t create symlink on second install .

[root@localhost rpmbuild]# rpm -e sotoolkit-1.5-1.noarch unlink: cannot unlink ‘/usr/bin/sotoolkit’: no such file or directory warning: %postun(sotoolkit-1.5-1.noarch) scriptlet failed, exit status 1 [root@localhost rpmbuild]#

no errors or warnings found rpm when checked rpmlint

any ideas cause ?

i have found problem :

in %install section wrongly :

ln -sf /integration/scripts/sotoolkit1.5/start.sh /usr/bin/sotoolkit 

and in %postun wrongly :

unlink /usr/bin/sotoolkit 

instead right thing in %install :

mkdir -p %{buildroot}/usr/bin/ ln -s /integration/scripts/sotoolkit1.5/start.sh %{buildroot}/usr/bin/sotoolkit 

then add link %files

/usr/bin/sotoolkit 

%postun can removed symlink part of files , removed if tool uninstalled.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -