next up previous
Next: Redhat based Up: Creating packages for keyTouch Previous: Running configure

The init scripts

At boot-time keytouch-init needs to be executed. Normally the "make install" creates an init-script called "" and runs a program (what program, depends on the distribution you are using) to create some links for the runlevels. Because when you are making a package you are normally running "make install" as a non-root user, which means you are not allowed to create the links and the "make install" will fail. To solve this problem we will have to modify keytouch-2.0/keytouch-init/Makefile. So open this file in your favorite text editor and go to the following lines:


  if [ `which chkconfig` ]; then \
    sed 's,\(^keytouchinit=\)\(.*\),\1$(bindir)/keytouch-init,' \
      > $(DESTDIR)$(sysconfdir)/init.d/; \
    chmod +x $(DESTDIR)/etc/init.d/; \
    chkconfig --add; \
  elif [ `which rc-update` ]; then \
    echo "$(bindir)/keytouch-init" > $(DESTDIR)/etc/init.d/; \
    chmod +x $(DESTDIR)/etc/init.d/; \
    rc-update add default; \
  elif [ -d /etc/rc2.d/ ]; then \
    echo "$(bindir)/keytouch-init" > $(DESTDIR)/etc/init.d/; \
    chmod +x $(DESTDIR)/etc/init.d/; \
    if [ `which update-rc.d` ]; then \
      update-rc.d defaults; \
    else \
      for i in 2 3 4 5; do \
        ln -sf $(DESTDIR)/etc/init.d/ $(DESTDIR)/etc/rc${i}.d/; \
      done \
    fi; \
  else \
    echo "$(bindir)/keytouch-init" > $(DESTDIR)/etc/rc.d/; \
    chmod +x $(DESTDIR)/etc/rc.d/; \

Remove these lines except the first two. The removed lines will be replaced by other lines. The replacing lines depend on the distribution you are using and will be discussed in the paragraphs below.


Marvin 2005-11-28