OpenWrt Forum Archive

Topic: need help for building that package!

The content of this topic has been archived on 17 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I am still hammering my had against the wall!!
But i think i am closer to the solution!
The File is Downloaded from SF and it is unziped by Make.
But it wont be compiled
Please can someone point me in the right direction??

I think i know where my Problem is, but i cant imagine any next step to do.

it anywhere arround here:

define Build/compile
    $(MAKE) -C $(PKG_BUILD_DIR)
endef

Cause i get this error when i do make package/cntlm/compile V=99:

make[1]: Entering directory `/home/cyberpunk/build/backfire'
make[2]: Entering directory `/home/cyberpunk/build/backfire/package/cntlm'
make[2]: Nothing to be done for `compile'.
make[2]: Leaving directory `/home/cyberpunk/build/backfire/package/cntlm'
make[1]: Leaving directory `/home/cyberpunk/build/backfire'

The completeMakefile in ./packages :

include $(TOPDIR)/rules.mk

PKG_NAME:=cntlm
PKG_VERSION:=0.35.1
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/cntlm
PKG_MD5SUM:=2547c73a1159062fdaa1877cc03a22f6

PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk

define Package/cntlm
    SECTION:=net
    CATEGORY:=Network
    SUBMENU:=Firewall Tunnel
    TITLE:=NTLM Authentication Proxy for MS ISA Server
endef

define Package/cntlm/description
endef

define Build/compile
    $(MAKE) -C $(PKG_BUILD_DIR)
endef

define Package/cntml/install
    $(INSTALL_DIR) $(1)/usr/bin
    $(CP) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/
endef

$(eval $(call BuildPackage,cntlm))

The cntlm Makefile from the tarball:

#
# You can tweak these three variables to make things install where you
# like, but do not touch more unless you know what you are doing. ;)
#
SYSCONFDIR=/usr/local/etc
BINDIR=/usr/local/bin
MANDIR=/usr/local/man

#
# Careful now...
# __BSD_VISIBLE is for FreeBSD AF_* constants
# _ALL_SOURCE is for AIX 5.3 LOG_PERROR constant
#
CC=gcc
OBJS=utils.o ntlm.o xcrypt.o config.o socket.o acl.o auth.o http.o proxy.o 
CFLAGS=$(FLAGS) -std=c99 -Wall -pedantic -O3 -D__BSD_VISIBLE -D_ALL_SOURCE -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112 -D_ISOC99_SOURCE -D_REENTRANT -DVERSION=\"`cat VERSION`\"
LDFLAGS=-lpthread
NAME=cntlm
VER=`cat VERSION`
DIR=`pwd`

$(NAME): configure-stamp $(OBJS)
    @echo "Linking $@"
    @$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS)

proxy.o: proxy.c
    @echo "Compiling $<"
    @if [ -z "$(SYSCONFDIR)" ]; then \
        $(CC) $(CFLAGS) -c proxy.c -o $@; \
    else \
        $(CC) $(CFLAGS) -DSYSCONFDIR=\"$(SYSCONFDIR)\" -c proxy.c -o $@; \
    fi

.c.o:
    @echo "Compiling $<"
    @$(CC) $(CFLAGS) -c -o $@ $<

install: $(NAME)
    # AIX?
    if [ -f /usr/bin/oslevel ]; then \
        install -O root -G system -M 755 -S -f $(BINDIR) $(NAME); \
        install -O root -G system -M 644 -f $(MANDIR)/man1 doc/$(NAME).1; \
        install -O root -G system -M 600 -c $(SYSCONFDIR) doc/$(NAME).conf; \
    else \
        install -D -o root -g root -m 755 -s $(NAME) $(BINDIR)/$(NAME); \
        install -D -o root -g root -m 644 doc/$(NAME).1 $(MANDIR)/man1/$(NAME).1; \
        [ -f $(SYSCONFDIR)/$(NAME).conf -o -z "$(SYSCONFDIR)" ] \
            || install -D -o root -g root -m 600 doc/$(NAME).conf $(SYSCONFDIR)/$(NAME).conf; \
    fi
    @echo; echo "Cntlm will look for configuration in $(SYSCONFDIR)/$(NAME).conf"

rpm:
    if [ `id -u` = 0 ]; then \
        redhat/rules binary; \
        redhat/rules clean; \
    else \
        fakeroot redhat/rules binary; \
        fakeroot redhat/rules clean; \
    fi

tgz:
    mkdir -p tmp
    rm -f tmp/$(NAME)-$(VER)
    ln -s $(DIR) tmp/$(NAME)-$(VER)
    sed "s/^\./$(NAME)-$(VER)/" doc/files.txt | tar zchf $(NAME)-$(VER).tar.gz --no-recursion -C tmp -T -
    rm tmp/$(NAME)-$(VER)
    rmdir tmp 2>/dev/null || true

win:
    groff -t -e -mandoc -Tps doc/cntlm.1 | ps2pdf - win32/cntlm_manual.pdf
    cat doc/cntlm.conf | unix2dos > win32/cntlm.ini
    cp /bin/cygwin1.dll /bin/cygrunsrv.exe win32/
    strip cntlm.exe
    cp cntlm.exe win32/
    rm -f cntlm-install
    ln -s win32 cntlm-install
    zip -r cntlm-$(VER)-win32.zip cntlm-install -x *.svn/*
    rm -f cntlm-install cntlm-$(VER)-win32.zip.sig

uninstall:
    rm -f $(BINDIR)/$(NAME) $(MANDIR)/man1/$(NAME).1 2>/dev/null || true

clean:
    @rm -f *.o cntlm cntlm.exe configure-stamp build-stamp config/config.h 2>/dev/null
    @rm -f cntlm-install win32/cyg* win32/cntlm* 2>/dev/null
    @rm -f config/endian config/gethostname config/strdup config/socklen_t config/*.exe
    @if [ -h Makefile ]; then rm -f Makefile; mv Makefile.gcc Makefile; fi

cleanp: clean
    @rm -f *.deb *.tgz *.tar.gz *.rpm *.o tags cntlm pid massif* callgrind* 2>/dev/null

distclean: clean
    if [ `id -u` = 0 ]; then \
        redhat/rules clean; \
    else \
        fakeroot redhat/rules clean; \
    fi

cheers

thanks for the reply i noticed that allready wink

This has worked well for me

..attitude_adjustment/package/cntlm/Makefile
_________________________________________________________________________

include $(TOPDIR)/rules.mk

PKG_NAME:=cntlm
PKG_VERSION:=0.92.3
PKG_RELEASE:=1

PKG_SOURCE:=cntlm_0.92.3.orig.tar.gz
PKG_SOURCE_URL:=http://ftp.de.debian.org/debian/pool/main/c/cntlm
PKG_MD5SUM:=675d375111dfafecebedfef0287053ad

PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)

include $(INCLUDE_DIR)/package.mk

define Package/cntlm
    SECTION:=net
    CATEGORY:=Network
    DEPENDS:=+libpthread
    SUBMENU:=Firewall Tunnel
    TITLE:=NTLM Authentication Proxy for MS ISA Server
endef

define Package/cntlm/description
endef

define Build/Configure
    $(call Build/Configure/Default,--with-linux-headers=$(LINUX_DIR))
endef

define Package/cntlm/install
    $(INSTALL_DIR) $(1)/usr/bin
    $(CP) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/bin/
    $(INSTALL_DIR) $(1)/etc
    $(INSTALL_DATA) ./files/cntlm.conf $(1)/etc/cntlm.conf
    $(INSTALL_DIR) $(1)/etc/init.d
    $(INSTALL_BIN) ./files/cntlm.init $(1)/etc/init.d/cntlm
endef

define Package/cntlm/postinst
#!/bin/sh
echo 'cntlm:*:114:65534::/var/run/cntlm:/bin/sh' >> /etc/passwd
echo 'cntlm:*:0:0:99999:7:::' >>  /etc/shadow
endef

$(eval $(call BuildPackage,cntlm))
===============================================================================

..attitude_adjustment/package/cntlm/patches/endian.patch 
## for architecture MIPS >> Checking endian... big endian
______________________________________________________________________________________

--- a/config/endian.c    2007-08-20 01:23:17.000000000 +0200
+++ b/config/endian.c    2013-10-20 11:05:42.890891807 +0200
@@ -1,16 +1,12 @@
#include <stdio.h>
#include <stdint.h>

-uint8_t num[] = { 0xEF, 0xBE };

-/*
- * RC: 1 = LE, 0 = BE
- */
int main(int argc, char **argv) {
-    int rc;
+    int rc;

-    rc = (*((uint16_t *)num) == 0xBEEF);
-    printf("%s\n", rc ? "little endian" : "big endian");
+    rc = 0;
+    printf("%s\n", rc ? "little endian" : "big endian");

-    return rc;
+    return rc;
}

==============================================================================
..attitude_adjustment/package/cntlm/files/cntlm.conf
______________________________________________________________________________
#
# Cntlm Authentication Proxy Configuration
#
# NOTE: all values are parsed literally, do NOT escape spaces,
# do not quote. Use 0600 perms if you use plaintext password.
#

Username    testuser
Domain        corp-uk
Password    password
# NOTE: Use plaintext password only at your own risk
# Use hashes instead. You can use a "cntlm -M" and "cntlm -H"
# command sequence to get the right config for your environment.
# See cntlm man page
# Example secure config shown below.
# PassLM          1AD35398BE6565DDB5C4EF70C0593492
# PassNT          77B9081511704EE852F94227CF48A793
### Only for user 'testuser', domain 'corp-uk'
# PassNTLMv2      D5826E9C665C37C80B53397D5C07BBCB

# Specify the netbios hostname cntlm will send to the parent
# proxies. Normally the value is auto-guessed.
#
# Workstation    netbios_hostname

# List of parent proxies to use. More proxies can be defined
# one per line in format <proxy_ip>:<proxy_port>
#
Proxy        10.0.0.41:8080
Proxy        10.0.0.42:8080

# List addresses you do not want to pass to parent proxies
# * and ? wildcards can be used
#
NoProxy        localhost, 127.0.0.*, 10.*, 192.168.*

# Specify the port cntlm will listen on
# You can bind cntlm to specific interface by specifying
# the appropriate IP address also in format <local_ip>:<local_port>
# Cntlm listens on 127.0.0.1:3128 by default
#
Listen        3128

# If you wish to use the SOCKS5 proxy feature as well, uncomment
# the following option. It can be used several times
# to have SOCKS5 on more than one port or on different network
# interfaces (specify explicit source address for that).
#
# WARNING: The service accepts all requests, unless you use
# SOCKS5User and make authentication mandatory. SOCKS5User
# can be used repeatedly for a whole bunch of individual accounts.
#
#SOCKS5Proxy    8010
#SOCKS5User    dave:password

# Use -M first to detect the best NTLM settings for your proxy.
# Default is to use the only secure hash, NTLMv2, but it is not
# as available as the older stuff.
#
# This example is the most universal setup known to man, but it
# uses the weakest hash ever. I won't have it's usage on my
# conscience. smile Really, try -M first.
#
#Auth        LM
#Flags        0x06820000

# Enable to allow access from other computers
#
#Gateway    yes

# Useful in Gateway mode to allow/restrict certain IPs
# Specifiy individual IPs or subnets one rule per line.
#
#Allow        127.0.0.1
#Deny        0/0

# GFI WebMonitor-handling plugin parameters, disabled by default
#
#ISAScannerSize     1024
#ISAScannerAgent    Wget/
#ISAScannerAgent    APT-HTTP/
#ISAScannerAgent    Yum/

# Headers which should be replaced if present in the request
#
#Header        User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)

# Tunnels mapping local port to a machine behind the proxy.
# The format is <local_port>:<remote_host>:<remote_port>
#
#Tunnel        11443:remote.com:443
================================================================================
/attitude_adjustment/package/cntlm/files/cntlm.init
________________________________________________________________________________

#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2011 OpenWrt.org

START=94

start() {
    mkdir -m 0755 -p /var/run/cntlm
        service_start /usr/bin/cntlm -U cntlm -c /etc/cntlm.conf
        }
       
        stop() {
            service_stop /usr/bin/cntlm
            }
===================================================================================

The discussion might have continued from here.