Generate Source For xar-452

This commit is contained in:
Thomas A 2023-03-01 09:46:03 -08:00
parent 817c36d71c
commit c3477d0d1a
11 changed files with 3215 additions and 0 deletions

108
gen/Makefile Normal file
View File

@ -0,0 +1,108 @@
# Clear out all vpaths, then set just one (default vpath) for the main build
# directory.
vpath
vpath % .
# Clear the default suffixes, so that built-in rules are not used.
.SUFFIXES :
#
# Standard definitions.
#
SHELL := /bin/sh
CC := gcc
LD := /usr/bin/ld
AR := /usr/bin/ar
RANLIB := /usr/bin/ranlib
INSTALL := /usr/bin/install -c
AUTOCONF :=
#
# Build parameters.
#
CPPFLAGS := -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
CFLAGS := -Wall -g
A_CFLAGS := $(CFLAGS)
S_CFLAGS := $(CFLAGS) -fPIC -DPIC
ifeq (macho, macho)
S_CFLAGS += -dynamic
endif
LDFLAGS :=
prefix := /usr/local
bindir := /usr/local/bin
datadir := /usr/local/share
libdir := /usr/local/lib
includedir := /usr/local/include
mandir := /usr/local/share/man
PREFIX := $(prefix)
BINDIR := $(bindir)
DATADIR := $(datadir)
LIBDIR := $(libdir)
INCLUDEDIR := $(includedir)
MANDIR := $(mandir)
dir_names := lib src
all : $(dir_names:%=%_all)
install : $(dir_names:%=%_install)
uninstall : $(dir_names:%=%_uninstall)
clean : $(dir_names:%=%_clean)
distclean : clean $(dir_names:%=%_distclean)
rm -f config.log
rm -f config.status
rm -f cfghdrs.stamp
rm -f cfgoutputs.stamp
rm -f configure.lineno
rm -f cfghdrs.stamp include/config.h
rm -f cfgoutputs.stamp Makefile include/xar.h lib/Makefile.inc lib/libxar.la.in src/Makefile.inc xar.spec
rm -rf autom4te.cache
relclean : distclean
rm -f configure
# Include Makefile.inc files in subdirectories.
include $(dir_names:%=%/Makefile.inc)
#
# Re-configuration rules.
#
ifeq (0, 1)
/Users/user/Downloads/xar-xar-452/xar/configure : /Users/user/Downloads/xar-xar-452/xar/configure.ac
cd .//Users/user/Downloads/xar-xar-452/xar/ && $(AUTOCONF)
config.status : /Users/user/Downloads/xar-xar-452/xar/configure
./config.status --recheck
# cfghdrs rules.
/Users/user/Downloads/xar-xar-452/xar/cfghdrs.stamp.in : /Users/user/Downloads/xar-xar-452/xar/configure.ac
echo stamp > /Users/user/Downloads/xar-xar-452/xar/cfghdrs.stamp.in
$(patsubst %, /Users/user/Downloads/xar-xar-452/xar/%.in, cfghdrs.stamp include/config.h) : config.status
cfghdrs.stamp : $(patsubst %, /Users/user/Downloads/xar-xar-452/xar/%.in, cfghdrs.stamp include/config.h)
./config.status
echo stamp > $@
$(filter-out cfghdrs.stamp, cfghdrs.stamp include/config.h) : cfghdrs.stamp
# cfgoutputs rules.
/Users/user/Downloads/xar-xar-452/xar/cfgoutputs.stamp.in : /Users/user/Downloads/xar-xar-452/xar/configure.ac
echo stamp > /Users/user/Downloads/xar-xar-452/xar/cfgoutputs.stamp.in
$(patsubst %, /Users/user/Downloads/xar-xar-452/xar/%.in, cfgoutputs.stamp Makefile include/xar.h lib/Makefile.inc lib/libxar.la.in src/Makefile.inc xar.spec) : config.status
cfgoutputs.stamp : $(patsubst %, /Users/user/Downloads/xar-xar-452/xar/%.in, cfgoutputs.stamp Makefile include/xar.h lib/Makefile.inc lib/libxar.la.in src/Makefile.inc xar.spec)
./config.status
$(filter-out \
cfgoutputs.stamp, \
$(patsubst %, %, cfgoutputs.stamp Makefile include/xar.h lib/Makefile.inc lib/libxar.la.in src/Makefile.inc xar.spec)) : cfgoutputs.stamp
endif

2
gen/cfghdrs.stamp Normal file
View File

@ -0,0 +1,2 @@
/* cfghdrs.stamp. Generated from cfghdrs.stamp.in by configure. */
stamp

1
gen/cfgoutputs.stamp Normal file
View File

@ -0,0 +1 @@
stamp

1342
gen/config.log Normal file

File diff suppressed because it is too large Load Diff

1054
gen/config.status Executable file

File diff suppressed because it is too large Load Diff

37
gen/include/config.h Normal file
View File

@ -0,0 +1,37 @@
/* include/config.h. Generated from config.h.in by configure. */
/* #undef HAVE_SYS_STATFS_H */
#define HAVE_SYS_XATTR_H 1
/* #undef HAVE_SYS_EXTATTR_H */
#define HAVE_SYS_PARAM_H 1
/* #undef HAVE_LGETXATTR */
/* #undef HAVE_LSETXATTR */
#define HAVE_GETXATTR 1
#define HAVE_SETXATTR 1
#define HAVE_GETATTRLIST 1
#define HAVE_SETATTRLIST 1
#define HAVE_CHFLAGS 1
#define HAVE_STATVFS 1
#define HAVE_STATFS 1
/* #undef HAVE_EXT2FS_EXT2_FS_H */
#define HAVE_STRUCT_STAT_ST_FLAGS 1
/* #undef HAVE_STRUCT_STATVFS_F_FSTYPENAME */
#define HAVE_STRUCT_STATFS_F_FSTYPENAME 1
#define HAVE_SYS_ACL_H 1
/* #undef HAVE_LIBUTIL_H */
#define HAVE_LIBPTHREAD 1
#define HAVE_ASPRINTF 1
#define HAVE_LIBBZ2 1
/* #undef HAVE_LIBLZMA */
#define HAVE_LCHOWN 1
#define HAVE_LCHMOD 1
#define HAVE_STRMODE 1
#define UID_STRING RId32
#define UID_CAST (uint32_t)
#define GID_STRING PRId32
#define GID_CAST (uint32_t)
#define INO_STRING PRId64
#define INO_HEXSTRING PRIx64
#define INO_CAST (uint64_t)
#define DEV_STRING PRId32
#define DEV_HEXSTRING PRIx32
#define DEV_CAST (uint32_t)

268
gen/include/xar.h Normal file
View File

@ -0,0 +1,268 @@
/*
* Copyright (c) 2005 Rob Braun
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Rob Braun nor the names of his contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
* 03-Apr-2005
* DRI: Rob Braun <bbraun@opendarwin.org>
*/
/*
* Portions Copyright 2006, Apple Computer, Inc.
* Christopher Ryan <ryanc@apple.com>
*/
#ifndef _XAR_H_
#define _XAR_H_
#if __cplusplus
extern "C" {
#endif
#define XAR_VERSION "1.8dev"
#include <sys/types.h>
#include <stdint.h>
#include <sys/stat.h>
#pragma pack(4)
struct xar_header {
uint32_t magic;
uint16_t size;
uint16_t version;
uint64_t toc_length_compressed;
uint64_t toc_length_uncompressed;
uint32_t cksum_alg;
};
#pragma pack()
typedef struct xar_header xar_header_t;
#define XAR_HEADER_MAGIC 0x78617221
#define XAR_EA_FORK "ea"
/* NONE is not supported for security reasons, and may not be supported by all implementations */
#define XAR_CKSUM_NONE 0
#define XAR_CKSUM_SHA1 1
/* MD5 is not supported for security reasons, and may not be supported by all implementations */
#define XAR_CKSUM_MD5 2
#define XAR_CKSUM_SHA256 3
#define XAR_CKSUM_SHA512 4
typedef void *xar_errctx_t;
typedef const struct __xar_file_t *xar_file_t;
typedef const struct __xar_iter_t *xar_iter_t;
typedef const struct __xar_t *xar_t;
typedef const struct __xar_subdoc_t *xar_subdoc_t;
typedef const struct __xar_signature_t *xar_signature_t;
typedef struct {
char *next_out;
unsigned int avail_out;
unsigned long long total_in;
unsigned long long total_out;
void *state;
} xar_stream;
typedef int32_t (*err_handler)(int32_t severit, int32_t instance, xar_errctx_t ctx, void *usrctx);
/* the signed_data must be allocated durring the callback and will be released by the xar lib after the callback */
typedef int32_t (*xar_signer_callback)(xar_signature_t sig, void *context, uint8_t *data, uint32_t length, uint8_t **signed_data, uint32_t *signed_len);
typedef void (*xar_progress_callback)(xar_t x, xar_file_t f, size_t sizeread);
#define READ 0
#define WRITE 1
/* xar stream return codes */
#define XAR_STREAM_OK 0
#define XAR_STREAM_END 1
#define XAR_STREAM_ERR -1
/* Valid xar options & values */
#define XAR_OPT_OWNERSHIP "ownership" /* setting owner/group behavior */
#define XAR_OPT_VAL_SYMBOLIC "symbolic" /* set owner/group based on names */
#define XAR_OPT_VAL_NUMERIC "numeric" /* set owner/group based on uid/gid */
#define XAR_OPT_TOCCKSUM "toc-cksum" /* set the toc checksum algorithm */
#define XAR_OPT_FILECKSUM "file-chksum" /* set the file checksum algorithm */
#define XAR_OPT_VAL_NONE "none"
#define XAR_OPT_VAL_SHA1 "sha1"
#define XAR_OPT_VAL_SHA256 "sha256"
#define XAR_OPT_VAL_SHA512 "sha512"
/* MD5 is not recommended for security reasons, and may not be supported by all implementations */
#define XAR_OPT_VAL_MD5 "md5"
#define XAR_OPT_COMPRESSION "compression" /* set the file compression type */
#define XAR_OPT_COMPRESSIONARG "compression-arg" /* set the compression opts */
#define XAR_OPT_VAL_GZIP "gzip"
#define XAR_OPT_VAL_BZIP "bzip2"
#define XAR_OPT_VAL_LZMA "lzma"
#define XAR_OPT_RSIZE "rsize" /* Read io buffer size */
#define XAR_OPT_COALESCE "coalesce" /* Coalesce identical heap blocks */
#define XAR_OPT_LINKSAME "linksame" /* Hardlink identical files */
#define XAR_OPT_PROPINCLUDE "prop-include" /* File property to include */
#define XAR_OPT_PROPEXCLUDE "prop-exclude" /* File property to exclude */
#define XAR_OPT_SAVESUID "savesuid" /* Preserve setuid/setgid bits */
#define XAR_OPT_VAL_TRUE "true"
#define XAR_OPT_VAL_FALSE "false"
/* xar signing algorithms */
#define XAR_SIG_SHA1RSA 1
/* xar error handler macros */
#define XAR_SEVERITY_DEBUG 1
#define XAR_SEVERITY_INFO 2
#define XAR_SEVERITY_NORMAL 3
#define XAR_SEVERITY_WARNING 4
#define XAR_SEVERITY_NONFATAL 5
#define XAR_SEVERITY_FATAL 6
#define XAR_ERR_ARCHIVE_CREATION 1
#define XAR_ERR_ARCHIVE_EXTRACTION 2
xar_t xar_open(const char *file, int32_t flags);
xar_t xar_open_digest_verify(const char *file, int32_t flags, void *expected_toc_digest, size_t expected_toc_digest_len);
int xar_close(xar_t x);
xar_header_t xar_header_get(xar_t x);
xar_file_t xar_add(xar_t x, const char *path);
xar_file_t xar_add_frombuffer(xar_t x, xar_file_t parent, const char *name, char *buffer, size_t length);
xar_file_t xar_add_folder(xar_t x, xar_file_t f, const char *name, struct stat *info);
xar_file_t xar_add_frompath(xar_t x, xar_file_t parent, const char *name, const char *realpath);
xar_file_t xar_add_from_archive(xar_t x, xar_file_t parent, const char *name, xar_t sourcearchive, xar_file_t sourcefile);
int32_t xar_extract(xar_t x, xar_file_t f);
int32_t xar_extract_tofile(xar_t x, xar_file_t f, const char *path);
int32_t xar_extract_tobuffer(xar_t x, xar_file_t f, char **buffer);
int32_t xar_extract_tobuffersz(xar_t x, xar_file_t f, char **buffer, size_t *size);
int32_t xar_extract_tostream_init(xar_t x, xar_file_t f, xar_stream *stream);
int32_t xar_extract_tostream(xar_stream *stream);
int32_t xar_extract_tostream_end(xar_stream *stream);
int32_t xar_verify(xar_t x, xar_file_t f);
int32_t xar_verify_progress(xar_t x, xar_file_t f, xar_progress_callback progress);
/* To get the checksum of the table of contents use this function.
* The function returns a alloced buffer that caller must free. */
void* xar_get_toc_checksum(xar_t x, size_t* buffer_size);
/* Returns XAR_CKSUM_* that maps to the type of the checksum. */
int32_t xar_get_toc_checksum_type(xar_t x);
const char *xar_opt_get(xar_t x, const char *option);
int32_t xar_opt_set(xar_t x, const char *option, const char *value);
int32_t xar_opt_unset(xar_t x, const char *option);
int32_t xar_prop_set(xar_file_t f, const char *key, const char *value);
int32_t xar_prop_create(xar_file_t f, const char *key, const char *value);
int32_t xar_prop_get(xar_file_t f, const char *key, const char **value);
xar_iter_t xar_iter_new(void);
void xar_iter_free(xar_iter_t i);
const char *xar_prop_first(xar_file_t f, xar_iter_t i);
const char *xar_prop_next(xar_iter_t i);
void xar_prop_unset(xar_file_t f, const char *key);
xar_file_t xar_file_first(xar_t x, xar_iter_t i);
xar_file_t xar_file_next(xar_iter_t i);
const char *xar_attr_get(xar_file_t f, const char *prop, const char *key);
int32_t xar_attr_set(xar_file_t f, const char *prop, const char *key, const char *value);
const char *xar_attr_first(xar_file_t f, const char *prop, xar_iter_t i);
const char *xar_attr_next(xar_iter_t i);
xar_subdoc_t xar_subdoc_new(xar_t x, const char *name);
int32_t xar_subdoc_prop_set(xar_subdoc_t s, const char *key, const char *value);
int32_t xar_subdoc_prop_get(xar_subdoc_t s, const char *key, const char **value);
int32_t xar_subdoc_attr_set(xar_subdoc_t s, const char *prop, const char *key, const char *value);
const char *xar_subdoc_attr_get(xar_subdoc_t s, const char *prop, const char *key);
xar_subdoc_t xar_subdoc_first(xar_t x);
xar_subdoc_t xar_subdoc_next(xar_subdoc_t s);
const char *xar_subdoc_name(xar_subdoc_t s);
int32_t xar_subdoc_copyout(xar_subdoc_t s, unsigned char **, unsigned int *);
int32_t xar_subdoc_copyin(xar_subdoc_t s, const unsigned char *, unsigned int);
void xar_subdoc_remove(xar_subdoc_t s);
/* signature api for adding various signature types */
xar_signature_t xar_signature_new(xar_t x,const char *type, int32_t length, xar_signer_callback callback, void *callback_context);
/* extended signatures are ignored by previous versions of xar */
xar_signature_t xar_signature_new_extended(xar_t x,const char *type, int32_t length, xar_signer_callback callback, void *callback_context);
const char *xar_signature_type(xar_signature_t s);
xar_signature_t xar_signature_first(xar_t x);
xar_signature_t xar_signature_next(xar_signature_t s);
int32_t xar_signature_add_x509certificate(xar_signature_t sig, const uint8_t *cert_data, uint32_t cert_len );
int32_t xar_signature_get_x509certificate_count(xar_signature_t sig);
int32_t xar_signature_get_x509certificate_data(xar_signature_t sig, int32_t index, const uint8_t **cert_data, uint32_t *cert_len);
uint8_t xar_signature_copy_signed_data(xar_signature_t sig, uint8_t **data, uint32_t *length, uint8_t **signed_data, uint32_t *signed_length, off_t *signed_offset);
/* Helper functions - caller must free returned memory */
char *xar_get_size(xar_t x, xar_file_t f);
char *xar_get_type(xar_t x, xar_file_t f);
char *xar_get_mode(xar_t x, xar_file_t f);
char *xar_get_owner(xar_t x, xar_file_t f);
char *xar_get_group(xar_t x, xar_file_t f);
char *xar_get_mtime(xar_t x, xar_file_t f);
/* For helping calling apps harden against hacked archives that attempt to escape their extraction roots. */
int xar_path_issane(char* path);
/* These are for xar modules and should never be needed from a calling app */
void xar_register_errhandler(xar_t x, err_handler callback, void *usrctx);
xar_t xar_err_get_archive(xar_errctx_t ctx);
xar_file_t xar_err_get_file(xar_errctx_t ctx);
const char *xar_err_get_string(xar_errctx_t ctx);
int xar_err_get_errno(xar_errctx_t ctx);
void xar_err_set_file(xar_t x, xar_file_t f);
void xar_err_set_formatted_string(xar_t x, const char *format, ...);
void xar_err_set_string(xar_t x, const char *str);
void xar_err_set_errno(xar_t x, int e);
void xar_err_new(xar_t x);
int32_t xar_err_callback(xar_t x, int32_t sev, int32_t err);
void xar_serialize(xar_t x, const char *file);
char *xar_get_path(xar_file_t f);
off_t xar_get_heap_offset(xar_t x);
uint64_t xar_ntoh64(uint64_t num);
#if __cplusplus
}
#endif
#endif /* _XAR_H_ */

205
gen/lib/Makefile.inc Normal file
View File

@ -0,0 +1,205 @@
#
# File lists.
#
# Internal headers.
LIBXAR_IINCS := asprintf.h
LIBXAR_IINCS := $(patsubst %, /Users/user/Downloads/xar-xar-452/xar/include/%, $(LIBXAR_IINCS))
LIBXAR_IINCS += include/config.h
# Headers.
LIBXAR_INCS :=
LIBXAR_INCS := $(patsubst %, /Users/user/Downloads/xar-xar-452/xar/include/%, $(LIBXAR_INCS))
LIBXAR_INCS += include/xar.h
# Sources.
LIBXAR_SRCS := archive.c arcmod.c b64.c bzxar.c darwinattr.c data.c ea.c err.c
LIBXAR_SRCS += ext2.c fbsdattr.c filetree.c io.c lzmaxar.c linuxattr.c hash.c
LIBXAR_SRCS += signature.c stat.c subdoc.c util.c zxar.c script.c macho.c
LIBXAR_SRCS := $(patsubst %, /Users/user/Downloads/xar-xar-452/xar/lib/%, $(LIBXAR_SRCS))
# Libraries. librxar is created such that it's possible to run xar without
# first installing libxar.
LIBXAR_LANAME := libxar.la
LIBXAR_ANAME := libxar.a
ifeq (elf, macho)
LIBRXAR_SNAME := librxar.so.1
LIBRXAR_LNAME := librxar.so
LIBRXAR_L := lib/$(LIBRXAR_LNAME)
LIBXAR_SNAME := libxar.so.1
LIBXAR_LNAME := libxar.so
LIBXAR_L := lib/$(LIBXAR_LNAME)
endif
ifeq (macho, macho)
LIBRXAR_SNAME := librxar.1.dylib
LIBRXAR_LNAME := librxar.dylib
LIBRXAR_L := lib/$(LIBRXAR_LNAME)
LIBXAR_SNAME := libxar.1.dylib
LIBXAR_LNAME := libxar.dylib
LIBXAR_L := lib/$(LIBXAR_LNAME)
endif
ifeq (aout, macho)
LIBRXAR_SNAME := librxar.so.1.0
LIBRXAR_LNAME :=
LIBRXAR_L :=
LIBXAR_SNAME := libxar.so.1.0
LIBXAR_LNAME :=
LIBXAR_L :=
endif
LIBXAR_LA := lib/$(LIBXAR_LANAME)
LIBXAR_A := lib/$(LIBXAR_ANAME)
LIBRXAR_S := lib/$(LIBRXAR_SNAME)
LIBXAR_S := lib/$(LIBXAR_SNAME)
#
# Include generated dependency files.
#
-include $(LIBXAR_SRCS:/Users/user/Downloads/xar-xar-452/xar/%.c=%.d)
LDFLAGS := -Llib $(LDFLAGS)
#
# User make'ables.
#
lib_all : lib_shared lib_static $(LIBXAR_LA)
ifeq (yes, yes)
lib_shared : $(LIBRXAR_S) $(LIBXAR_S)
else
lib_shared :
endif
ifeq (yes, yes)
lib_static : $(LIBXAR_A)
else
lib_static :
endif
lib_install : lib_shared lib_static
/usr/bin/install -c -d $(DESTDIR)$(INCLUDEDIR)/xar
/usr/bin/install -c -m 0644 $(LIBXAR_INCS) $(DESTDIR)$(INCLUDEDIR)/xar
/usr/bin/install -c -d $(DESTDIR)$(LIBDIR)
ifeq (yes, yes)
/usr/bin/install -c -m 0755 $(LIBXAR_S) $(DESTDIR)$(LIBDIR)
ifneq ($(words "" $(LIBXAR_LNAME)), 1)
rm -f $(DESTDIR)$(LIBDIR)/$(LIBXAR_LNAME)
ln -s $(LIBXAR_SNAME) $(DESTDIR)$(LIBDIR)/$(LIBXAR_LNAME)
endif
endif
ifeq (yes, yes)
/usr/bin/install -c -m 0644 $(LIBXAR_A) $(DESTDIR)$(LIBDIR)
endif
/usr/bin/install -c -m 0644 $(LIBXAR_LA) $(DESTDIR)$(LIBDIR)
lib_uninstall :
rm -rf $(DESTDIR)$(INCLUDEDIR)/xar
ifeq (yes, yes)
rm -f $(DESTDIR)$(LIBDIR)/$(LIBXAR_SNAME)
ifneq ($(words "" $(LIBXAR_LNAME)), 1)
rm -f $(DESTDIR)$(LIBDIR)/$(LIBXAR_LNAME)
endif
endif
ifeq (yes, yes)
rm -f $(DESTDIR)$(LIBDIR)/$(LIBXAR_ANAME)
endif
rm -f $(DESTDIR)$(LIBDIR)/$(LIBXAR_LANAME)
lib_clean :
rm -f $(LIBRXAR_S) $(LIBRXAR_L)
rm -f $(LIBXAR_S) $(LIBXAR_L)
rm -f $(LIBXAR_A) $(LIBXAR_LA)
@rm -f lib/.libs/$(LIBXAR_LNAME)
@rm -f lib/.libs/$(LIBXAR_ANAME)
@-rmdir lib/.libs
rm -f $(LIBXAR_SRCS:/Users/user/Downloads/xar-xar-452/xar/%.c=%.o)
rm -f $(LIBXAR_SRCS:/Users/user/Downloads/xar-xar-452/xar/%.c=%.d)
rm -f $(LIBXAR_SRCS:/Users/user/Downloads/xar-xar-452/xar/%.c=%.static.o)
rm -f $(LIBXAR_SRCS:/Users/user/Downloads/xar-xar-452/xar/%.c=%.static.d)
lib_distclean :
#
# Various flags.
#
CPPFLAGS := -Iinclude $(CPPFLAGS)
CPPFLAGS := -I/Users/user/Downloads/xar-xar-452/xar/include $(CPPFLAGS)
#
# Build rules.
#
# librxar is a version of the xar library that is usable without first
# installing libxar.
$(LIBRXAR_S) : $(LIBXAR_SRCS:/Users/user/Downloads/xar-xar-452/xar/%.c=%.o)
@mkdir -p $(@D)
ifeq (elf, macho)
$(CC) -shared -Wl,-soname,$(LIBXAR_SNAME) -o $@ $+ $(LDFLAGS) -lpthread -lbz2 -lz -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib -lxml2 -lz -lpthread -licucore -lm
endif
ifeq (macho, macho)
$(CC) -dynamiclib -compatibility_version 1 -current_version 1 -install_name /Users/user/Downloads/xar-xar-452/gen/$(LIBRXAR_S) -o $@ $+ $(LDFLAGS) -lpthread -lbz2 -lz -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib -lxml2 -lz -lpthread -licucore -lm
endif
ifeq (aout, macho)
$(CC) -shared -o $@ $+
endif
ifneq ($(words "" $(LIBRXAR_L)), 1)
rm -f $(LIBRXAR_L)
ln -s $(LIBRXAR_SNAME) $(LIBRXAR_L)
endif
$(LIBXAR_S) : $(LIBXAR_SRCS:/Users/user/Downloads/xar-xar-452/xar/%.c=%.o)
@mkdir -p $(@D)
ifeq (elf, macho)
$(CC) -shared -Wl,-soname,$(LIBXAR_SNAME) -o $@ $+ $(LDFLAGS) -lpthread -lbz2 -lz -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib -lxml2 -lz -lpthread -licucore -lm
endif
ifeq (macho, macho)
$(CC) -dynamiclib -compatibility_version 1 -current_version 1 -install_name $(LIBDIR)/$(LIBXAR_SNAME) -o $@ $+ $(LDFLAGS) -lpthread -lbz2 -lz -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib -lxml2 -lz -lpthread -licucore -lm
endif
ifeq (aout, macho)
$(CC) -shared -o $@ $+
endif
ifneq ($(words "" $(LIBXAR_L)), 1)
rm -f $(LIBXAR_L)
ln -s $(LIBXAR_SNAME) $(LIBXAR_L)
endif
ifeq (yes, yes)
LT_LIBXAR_SNAME := $(LIBXAR_SNAME)
LT_LIBXAR_LNAME := $(LIBXAR_LNAME)
else
LT_LIBXAR_SNAME :=
LT_LIBXAR_LNAME :=
endif
ifeq (yes, yes)
LT_LIBXAR_ANAME := $(LIBXAR_ANAME)
else
LT_LIBXAR_ANAME :=
endif
$(LIBXAR_LA) : $(LIBXAR_LA).in
@mkdir -p lib/.libs
ifeq (yes, yes)
@ln -sf ../$(LIBXAR_LNAME) lib/.libs/$(LIBXAR_LNAME)
endif
ifeq (yes, yes)
@ln -sf ../$(LIBXAR_ANAME) lib/.libs/$(LIBXAR_ANAME)
endif
sed -e s/@LIBXAR_SNAME@/$(LT_LIBXAR_SNAME)/ -e s/@LIBXAR_LNAME@/$(LT_LIBXAR_LNAME)/ -e s/@LIBXAR_ANAME@/$(LT_LIBXAR_ANAME)/ < $< > $@
$(LIBXAR_A) : $(LIBXAR_SRCS:/Users/user/Downloads/xar-xar-452/xar/%.c=%.static.o)
@mkdir -p $(@D)
$(AR) cvr $@ $+
$(RANLIB) $@
lib/%.o : /Users/user/Downloads/xar-xar-452/xar/lib/%.c
@mkdir -p $(@D)
$(CC) $(S_CFLAGS) $(CPPFLAGS) -c $< -o $@
@$(SHELL) -ec "$(CC) -MM $(CPPFLAGS) $< | sed \"s/\($(subst /,\/,$(notdir $(basename $@)))\)\.o\([ :]*\)/$(subst /,\/,$(strip $(dir $@)))\1.o \2/g\" > $(@:%.o=%.d)"
lib/%.static.o : /Users/user/Downloads/xar-xar-452/xar/lib/%.c
@mkdir -p $(@D)
$(CC) $(A_CFLAGS) $(CPPFLAGS) -c $< -o $@
@$(SHELL) -ec "$(CC) -MM $(CPPFLAGS) $< | sed \"s/\($(subst /,\/,$(notdir $(basename $@)))\)\.o\([ :]*\)/$(subst /,\/,$(strip $(dir $@)))\1.o \2/g\" > $(@:%.o=%.d)"

35
gen/lib/libxar.la.in Normal file
View File

@ -0,0 +1,35 @@
# libxar.la - a libtool library file
# Generated by Xar 1.8dev for libtool
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname='@LIBXAR_SNAME@'
# Names of this library.
library_names='@LIBXAR_SNAME@ @LIBXAR_LNAME@'
# The name of the static archive.
old_library='@LIBXAR_ANAME@'
# Libraries that this one depends upon.
dependency_libs='-lpthread -lbz2 -lz -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib -lxml2 -lz -lpthread -licucore -lm'
# Version information for libxar.
current=0
age=0
revision=1
# Is this an already installed library?
installed=no
# Should we warn about portability when linking against -modules?
shouldnotlink=no
# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''
# Directory that this library needs to be installed in:
libdir='/usr/local/lib'

65
gen/src/Makefile.inc Normal file
View File

@ -0,0 +1,65 @@
#
# Include generated dependency files.
#
XAR_SRCS := xar.c
XAR_SRCS := $(patsubst %, /Users/user/Downloads/xar-xar-452/xar/src/%, $(XAR_SRCS))
-include $(XAR_SRCS:/Users/user/Downloads/xar-xar-452/xar/%.c=%.d)
src_all : src/xar src/ixar
src_install : src/ixar
/usr/bin/install -c -d $(DESTDIR)$(BINDIR)
/usr/bin/install -c -m 0755 $< $(DESTDIR)$(BINDIR)/xar
/usr/bin/install -c -d $(DESTDIR)$(MANDIR)/man1
/usr/bin/install -c -m 0644 /Users/user/Downloads/xar-xar-452/xar/src/xar.1 $(DESTDIR)$(MANDIR)/man1
src_uninstall :
rm -f $(DESTDIR)/$(BINDIR)/xar
rm -f $(DESTDIR)/$(MANDIR)/man1/xar.1
src_clean :
rm -f src/xar
rm -f src/ixar
rm -f $(XAR_SRCS:/Users/user/Downloads/xar-xar-452/xar/%.c=%.o)
rm -f $(XAR_SRCS:/Users/user/Downloads/xar-xar-452/xar/%.c=%.d)
src_distclean :
ifeq (yes, yes)
LIBRXAR := $(LIBRXAR_S)
endif
ifeq (yes, yes)
LIBRXAR := $(LIBXAR_A)
endif
# xar links against librxar, so that it can be run without first installing
# libxar.
src/% : src/%.o $(LIBRXAR)
@mkdir -p $(@D)
ifneq ($(words "" ), 1)
$(CC) $(CFLAGS) -o $@ $< /Users/user/Downloads/xar-xar-452/gen/lib $(LDFLAGS) $(LIBRXAR) -lpthread -lbz2 -lz -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib -lxml2 -lz -lpthread -licucore -lm
else
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LIBRXAR) -lpthread -lbz2 -lz -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib -lxml2 -lz -lpthread -licucore -lm
endif
ifeq (yes, yes)
LIBXAR := $(LIBXAR_A)
endif
ifeq (yes, yes)
LIBXAR := $(LIBXAR_S)
endif
# ixar is the version of the xar binary that gets installed.
src/i% : src/%.o $(LIBXAR)
@mkdir -p $(@D)
ifneq ($(words "" ), 1)
$(CC) $(CFLAGS) -o $@ $< $(LIBDIR) $(LDFLAGS) $(LIBXAR) -lpthread -lbz2 -lz -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib -lxml2 -lz -lpthread -licucore -lm
else
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LIBXAR) -lpthread -lbz2 -lz -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib -lxml2 -lz -lpthread -licucore -lm
endif
src/%.o : /Users/user/Downloads/xar-xar-452/xar/src/%.c
@mkdir -p $(@D)
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
@$(SHELL) -ec "$(CC) -MM $(CPPFLAGS) $< | sed \"s/\($(subst /,\/,$(notdir $(basename $@)))\)\.o\([ :]*\)/$(subst /,\/,$(strip $(dir $@)))\1.o \2/g\" > $(@:%.o=%.d)"

98
gen/xar.spec Normal file
View File

@ -0,0 +1,98 @@
Summary: The XAR project aims to provide an easily extensible archive format.
Name: xar
Version: 1.8dev
Release: 0
License: BSD
Group: Applications/Archiving
URL: http://code.google.com/p/%{name}/
Source: http://%{name}.googlecode.com/files/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%ifos linux
BuildRequires: libxml2-devel >= 2.6.11
BuildRequires: openssl-devel
BuildRequires: bzip2-devel
BuildRequires: zlib-devel
BuildRequires: /usr/bin/awk
%endif
%description
The XAR project aims to provide an easily extensible archive format. Important
design decisions include an easily extensible XML table of contents for random
access to archived files, storing the toc at the beginning of the archive to
allow for efficient handling of streamed archives, the ability to handle files
of arbitrarily large sizes, the ability to choose independent encodings for
individual files in the archive, the ability to store checksums for individual
files in both compressed and uncompressed form, and the ability to query the
table of content's rich meta-data.
%package devel
Summary: Libraries and header files required for xar.
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
Libraries and header files required for xar.
%prep
%setup -q -n %{name}-%{version}
%build
%configure --disable-static
%{__make} %{?_smp_mflags}
%install
%{__rm} -rf $RPM_BUILD_ROOT
%{__make} install DESTDIR=%{buildroot}
%clean
%{__rm} -rf $RPM_BUILD_ROOT
%ifos linux
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%endif
%files
%defattr(-,root,root,-)
%doc LICENSE TODO
%{_bindir}/%{name}
%ifnos darwin
%{_libdir}/lib%{name}.so.*
%else
%{_libdir}/lib%{name}.*.dylib
%endif
%{_mandir}/man1/xar.1*
%files devel
%defattr(-,root,root,-)
%{_includedir}/%{name}/%{name}.h
%ifnos darwin
%{_libdir}/lib%{name}.so
%else
%{_libdir}/lib%{name}.dylib
%endif
%exclude %{_libdir}/lib%{name}.la
%changelog
* Wed Sep 12 2007 Anders F Bjorklund <afb@rpm.org> 1.5.1-0
- fixed spec, made darwin compatible
- moved non-versioned lib from devel
* Mon May 07 2007 Rob Braun <bbraun@synack.net> 0:1.5-1
- 1.5
* Thu Feb 23 2006 Rob Braun <bbraun@opendarwin.org> - 0:1.2-1
- 1.4
* Mon Oct 24 2005 Rob Braun <bbraun@opendarwin.org> - 0:1.2-1
- 1.3
* Wed Sep 21 2005 Jason Corley <jason.corley@gmail.com> - 0:1.1-1
- 1.1
- correct library version
- add specific version to libxml requirements
* Fri Sep 09 2005 Jason Corley <jason.corley@gmail.com> - 0:1.0-1
- 1.0
* Sat Apr 23 2005 Jason Corley <jason.corley@gmail.com> - 0:0.0.0-0.20050423.0
- Initial RPM release.