Incorrect default install path for Apache on Mac

Alex Smith alex.smith.93 at gmail.com
Thu May 26 07:48:47 CEST 2011


On 2011-05-23, at 8:01 PM, Lars Hjemli wrote:

> On Tue, May 24, 2011 at 01:30, Alex Smith <alex.smith.93 at gmail.com> wrote:
>> On Mac install goes more like this however, it won't install to the default htdocs dir on a mac:
>> make get-git
>> make NEEDS_LIBICONV=YesPlease get-git
>> sudo make NEEDS_LIBICONV=YesPlease install
> 
> sligthly off-topic:
> * the get-git target is only needed once (to download the sources for libgit.a)
> * if you've done 'git submodule init; git submodule update', there's
> no need to 'make get-git' at all
> * specifying NEEDS_LIBICONV is also only needed once (during building,
> not install)
> 

I made a typo earlier but not where you would think. From experience getting this to compile, it's necessary for me to compile like:

# Compile just cgit (if you already have git)
make NEEDS_LIBICONV=YesPlease
# Download/compile git and compile cgit
make NEEDS_LIBICONV=YesPlease get-git
# Do the install:
sudo make NEEDS_LIBICONV=YesPlease install

If you don't include the NEEDS_LIBICONV=YesPlease to the install phase I get:
sudo make install
    SUBDIR git
    SUBDIR git
    CC cgit
Undefined symbols:
  "_iconv", referenced from:
      _reencode_string in libgit.a(utf8.o)
  "_iconv_close", referenced from:
      _reencode_string in libgit.a(utf8.o)
      _reencode_string in libgit.a(utf8.o)
  "_iconv_open", referenced from:
      _reencode_string in libgit.a(utf8.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status

If this can carry over to the install that would be cool.

I looked at the makefile and in order for it to "comply" with where to put it, you'd need patience and support spaces in directory paths. It unknowingly fails when presented with spaces for libdir:

Proper directories for these files are:
CGIT_SCRIPT_PATH=/Library/WebServer/Documents/cgit
libdir=/Library/Application\ Support
docdir=/Library/Documentation/Applications/cgit

I think this should comply with standards in the Darwin world.

>> 
>> Instead it installs to as evidenced by the Terminal:
>> install -m 0755 -d /var/www/htdocs/cgit
>> install -m 0755 cgit /var/www/htdocs/cgit/cgit.cgi
>> install -m 0755 -d /var/www/htdocs/cgit
>> install -m 0644 cgit.css /var/www/htdocs/cgit/cgit.css
>> install -m 0644 cgit.png /var/www/htdocs/cgit/cgit.png
>> install -m 0755 -d /usr/lib/cgit/filters
>> install -m 0755 filters/* /usr/lib/cgit/filters
> 
> Yeah, these are the default paths, as defined at the start of the Makefile.
> 
>> 
>> Default directory for Mac web documents (i.e. htdocs) is: /Library/WebServer/Documents
> 
> Ok. Running 'make CGIT_SCRIPT_PATH=/Library/WebServer/Documents
> install' would have put (some of) the files at the right place, put a
> better solution is to specify these variables in a file named
> cgit.conf which is always included by the Makefile (see the start of
> the Makefile for these and other variables you might want to adjust in
> cgit.conf).
> 
> Also, a new darwin-specific section in the Makefile would probably be
> helpful, i.e. something like this (totally untested...):
> 
> diff --git a/Makefile b/Makefile
> index af2879e..43b061c 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -49,6 +49,12 @@ ifeq ($(uname_O),Cygwin)
> 	NEEDS_LIBICONV = YesPlease
> endif
> 
> +ifeq ($(uname_S),Darwin)
> +	NEEDS_LIBICONV = YesPlease
> +	CGIT_SCRIPT_PATH=/Library/WebServer/Documents
> +	filterdir=/Library/cgit/filters
> +endif
> +
> #
> # Let the user override the above settings.
> #
> 
> 
>> I feel I can easily just move all files under /var/www/htdocs to this directory, but
>> is it safe to move /usr/lib/cgit/filters?
> 
> The filter scripts are not supposed to be accessible by apache, so I'd
> move them to e.g. /Library/cgit/filters (just guessing, I don't know
> the fs layout on darwin...)
> 
> -- 
> larsh





More information about the CGit mailing list