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 "keytouch-init.sh" 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:

install-data-local:
  @$(NORMAL_INSTALL)

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

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.



Subsections

Marvin 2005-11-28