From: Jens P. <pet...@re...> - 2002-11-18 03:41:05
|
Martin Sj=F6gren <md...@md...> writes: > I'm toying with the idea of packaging gtk2hs for Debian, and I have a > few questions and suggestions. Please Cc me your answers, I'm not > subscribed to the list. >=20 > * The way it is now, the install target does both file copying, and the > ghc-pkg management. For building a Debian package, that absolutely sucks > :) since I want to call ghc-pkg in the post-installation script, not > when building from source. My suggestion is to let install depend on a > new target install-files (for example), that does the copying, and > install only does the ghc-pkg stuff. That way, it'll still be 'make > install' for a normal install, but I can do 'make install-files' in the > Debian package. Yep, this is a known problem with the current Makefiles, which I also hit when I started rpm packaging gtk2hs. Locally I have the following modification to workaround this. I haven't looked at this for a while, perhaps it can be done in a better way, but at least this has been working for me for a while. Jens Index: mk/library.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/gtk2hs/gtk2hs/mk/library.mk,v retrieving revision 1.7 diff -u -r1.7 library.mk --- mk/library.mk 3 Nov 2002 20:35:01 -0000 1.7 +++ mk/library.mk 18 Nov 2002 03:32:11 -0000 @@ -50,34 +50,40 @@ installdirs : $(INSTALL) -d $(INST_HIDIR) $(INST_LIBDIR) $(INST_INCLDIR) =20 -install : installcheck $(TARGETOK) installdirs interactiveInstall=20 +install : $(TARGETOK) installdirs interactiveInstall pkg-conf $(INSTALL) -c -m644 $(ALLHSFILES:.hs=3D.hi) $(INST_HIDIR) $(INSTALL) -c -m644 $(TARGETOK) $(INST_LIBDIR) ifneq ($(strip $(EXTRA_CFILES) $(STUBHFILES)),) $(INSTALL) -c -m644 $(STUBHFILES) $(EXTRA_CFILES:.c=3D.h) $(INST_INCLDIR) endif + $(INSTALL) -c -m644 $(PACKAGENAME).conf $(INST_LIBDIR) + +pkg-conf : @echo Package {\ name =3D \"$(PACKAGENAME)\",\ import_dirs =3D [\"$(INST_HIDIR)\"],\ source_dirs =3D [],\ - library_dirs =3D [$(call makeTextList, $(INST_LIBDIR) \ - $(patsubst -L%,%,$(EXTRA_LIBS_ONLY_L)))],\ + library_dirs =3D [\"$(INST_LIBDIR)\"],\ hs_libraries =3D [\"$(LIBNAME)\"],\ extra_libraries =3D [$(call makeTextList,\ $(patsubst -l%,%,$(filter -l%,$(EXTRA_LIBS_ONLY_Ll) \ $(LIBS_ONLY_L))))],\ - include_dirs =3D [$(call makeTextList, $(INPL_INCLDIR)\ - $(patsubst -I%,%,$(EXTRA_CPPFLAGS_ONLY_I)))],\ + include_dirs =3D [],\ c_includes =3D [$(call makeTextList,\ $(notdir $(STUBHFILES)) $(HEADER))],\ package_deps =3D [$(call makeTextList,$(NEEDPACKAGES))],\ extra_ghc_opts =3D [$(call makeTextList,$(EXTRAHC_FLAGS))],\ extra_cc_opts =3D [],\ extra_ld_opts =3D [$(subst +,$(SPACE),$(call makeTextList,\ - $(addprefix -u+,$(EXTRA_SYMBOLS))))]} | $(PKG) --force -a + $(addprefix -u+,$(EXTRA_SYMBOLS))))]} > $(PACKAGENAME).conf =20 -uninstall : interactiveUninstall +install-pkg : installcheck pkg-conf install + $(PKG) -i $(PACKAGENAME).conf -a=20 + +uninstall-pkg : uninstall $(PKG) -r $(PACKAGENAME) + +uninstall : interactiveUninstall $(RM) $(addprefix $(INST_INCLDIR)/,$(notdir $(ALLHSFILES:.hs=3D.hi))) $(RM) $(addprefix $(INST_LIBDIR)/,$(TARGETOK)) $(RM) $(addprefix $(INST_INCLDIR)/,$(notdir $(STUBHFILES)\ |