Changeset 20731


Ignore:
Timestamp:
2010-04-06T11:26:42+02:00 (8 years ago)
Author:
nico
Message:

[packages] file: prevent spurious rebuilds, caused by touching files during Package/file/install, use Hooks/... instead, cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • packages/libs/file/Makefile

    r19714 r20731  
    2121include $(INCLUDE_DIR)/package.mk 
    2222 
    23 define Package/libmagic 
    24   SECTION:=libs 
    25   CATEGORY:=Libraries 
    26   DEPENDS:=+zlib 
    27   TITLE:=Determines file type using 'magic' numbers 
     23define Package/file/Default 
     24  TITLE:=File type determination 
    2825  URL:=ftp://ftp.astron.com/pub/file/ 
    2926endef 
    3027 
    3128define Package/file 
     29$(call package/file/Default) 
    3230  SECTION:=utils 
    3331  CATEGORY:=Utilities 
     32  TITLE+= utility 
    3433  DEPENDS:=+libmagic 
    35   TITLE:=Determines file type using 'magic' numbers 
    36   URL:=ftp://ftp.astron.com/pub/file/ 
    3734endef 
    3835 
    39 define Package/file/description 
    40  File tests each argument in an attempt to classify it. There 
    41  are three sets of tests, performed in this order: filesystem 
    42  tests, magic number tests, and language tests. The first test 
    43  that succeeds causes the file type to be printed. 
    44  
    45  Starting with version 4, the file command is not much more than 
    46  a wrapper around the "magic" library. 
     36define Package/libmagic 
     37$(call package/file/Default) 
     38  SECTION:=libs 
     39  CATEGORY:=Libraries 
     40  TITLE+= library 
     41  DEPENDS:=+zlib 
    4742endef 
    4843 
    49 MAKE_PATH:=src 
     44CONFIGURE_ARGS += \ 
     45        --enable-shared \ 
     46        --enable-static \ 
     47 
     48MAKE_PATH := src 
    5049 
    5150TARGET_CFLAGS += $(FPIC) 
    5251 
    53 define Build/Configure 
    54         $(call Build/Configure/Default, \ 
    55                 --enable-shared \ 
    56                 --enable-static \ 
    57                 --disable-rpath \ 
    58                 --without-libiconv-prefix \ 
    59                 --without-libintl-prefix \ 
    60         ) 
     52define Build/Compile/magic 
     53        ( cd $(PKG_BUILD_DIR)/magic/Magdir; \ 
     54                for f in `ls`; do \ 
     55                        cat $$$${f}; \ 
     56                done \ 
     57        ) > $(PKG_BUILD_DIR)/magic/magic 
    6158endef 
     59Hooks/Compile/Post += Build/Compile/magic 
    6260 
    63 define Build/Prepare 
    64         $(call Build/Prepare/Default) 
    65         chmod -R u+w $(PKG_BUILD_DIR) 
     61define Build/Install/magic 
     62        $(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/share/file 
     63        $(INSTALL_DATA) $(PKG_BUILD_DIR)/magic/magic $(PKG_INSTALL_DIR)/usr/share/file/ 
    6664endef 
     65Hooks/Install/Post += Build/Install/magic 
    6766 
    6867define Build/InstallDev 
     
    7372endef 
    7473 
     74define Package/file/install 
     75        $(INSTALL_DIR) $(1)/usr/bin 
     76        $(CP) $(PKG_INSTALL_DIR)/usr/bin/file $(1)/usr/bin/ 
     77        $(INSTALL_DIR) $(1)/usr/share/file 
     78        $(CP) $(PKG_INSTALL_DIR)/usr/share/file/magic $(1)/usr/share/file/ 
     79endef 
     80 
    7581define Package/libmagic/install 
    7682        $(INSTALL_DIR) $(1)/usr/lib 
     
    7884endef 
    7985 
    80 define Package/file/install 
    81         $(INSTALL_DIR) $(1)/usr/bin 
    82         $(INSTALL_DIR) $(1)/usr/share/file 
    83         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/file $(1)/usr/bin 
    84         (cd $(PKG_BUILD_DIR)/magic/Magdir; rm -f magic.mime; for file in `ls`; do cat $$$${file} >> magic.mime; done) 
    85         $(INSTALL_DATA) $(PKG_BUILD_DIR)/magic/Magdir/magic.mime $(1)/usr/share/file/magic 
    86 endef 
    87  
     86$(eval $(call BuildPackage,file)) 
    8887$(eval $(call BuildPackage,libmagic)) 
    89 $(eval $(call BuildPackage,file)) 
Note: See TracChangeset for help on using the changeset viewer.