~ubuntu-branches/ubuntu/feisty/libnss-db/feisty

« back to all changes in this revision

Viewing changes to debian/local/db-Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Ben Collins
  • Date: 2002-04-12 13:12:29 UTC
  • Revision ID: james.westby@ubuntu.com-20020412131229-2sfdv2fix4sij8lf
Tags: 2.2-6
Rebuild with newer libdb3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Makefile to (re-)generate db versions of system database files.
 
2
# Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
 
3
# This file is part of the GNU C Library.
 
4
# Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
5
#
 
6
# The GNU C Library is free software; you can redistribute it and/or
 
7
# modify it under the terms of the GNU Library General Public License as
 
8
# published by the Free Software Foundation; either version 2 of the
 
9
# License, or (at your option) any later version.
 
10
 
 
11
# The GNU C Library is distributed in the hope that it will be useful,
 
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
# Library General Public License for more details.
 
15
#
 
16
# You should have received a copy of the GNU Library General Public
 
17
# License along with the GNU C Library; see the file COPYING.LIB.  If not,
 
18
# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
19
# Boston, MA 02111-1307, USA.  */
 
20
 
 
21
 
 
22
# XXX: Do not edit this file, it will be overwritten on upgrades. Instead
 
23
# edit /etc/default/libnss-db.
 
24
 
 
25
include /etc/default/libnss-db
 
26
 
 
27
DATABASES = $(wildcard $(addprefix $(ETC)/,$(DBS)))
 
28
 
 
29
all: $(patsubst %,$(VAR_DB)/%.db,$(notdir $(DATABASES)))
 
30
 
 
31
 
 
32
$(VAR_DB)/passwd.db: $(ETC)/passwd
 
33
        @echo -n "$(patsubst %.db,%,$(@F))... "
 
34
        @$(AWK) 'BEGIN { FS=":"; OFS=":"; cnt=0 } \
 
35
                 /^[ \t]*$$/ { next } \
 
36
                 /^[ \t]*#/ { next } \
 
37
                 { printf "0%u ", cnt++; print } \
 
38
                 /^[^#]/ { printf ".%s ", $$1; print; \
 
39
                           printf "=%s ", $$3; print }' $^ | \
 
40
        $(MAKEDB) -o $@ -
 
41
        @echo "done."
 
42
 
 
43
$(VAR_DB)/group.db: $(ETC)/group
 
44
        @echo -n "$(patsubst %.db,%,$(@F))... "
 
45
        @$(AWK) 'BEGIN { FS=":"; OFS=":"; cnt=0 } \
 
46
                 /^[ \t]*$$/ { next } \
 
47
                 /^[ \t]*#/ { next } \
 
48
                 { printf "0%u ", cnt++; print } \
 
49
                 /^[^#]/ { printf ".%s ", $$1; print; \
 
50
                           printf "=%s ", $$3; print }' $^ | \
 
51
        $(MAKEDB) -o $@ -
 
52
        @echo "done."
 
53
 
 
54
$(VAR_DB)/ethers.db: $(ETC)/ethers
 
55
        @echo -n "$(patsubst %.db,%,$(@F))... "
 
56
        @$(AWK) 'BEGIN { cnt=0 } \
 
57
                 /^[ \t]*$$/ { next } \
 
58
                 /^[ \t]*#/ { next } \
 
59
                 { printf "0%u ", cnt++; print } \
 
60
                 /^[^#]/ { printf ".%s ", $$1; print; \
 
61
                           printf "=%s ", $$2; print }' $^ | \
 
62
        $(MAKEDB) -o $@ -
 
63
        @echo "done."
 
64
 
 
65
$(VAR_DB)/protocols.db: $(ETC)/protocols
 
66
        @echo -n "$(patsubst %.db,%,$(@F))... "
 
67
        @$(AWK) 'BEGIN { cnt=0 } \
 
68
                 /^[ \t]*$$/ { next } \
 
69
                 /^[ \t]*#/ { next } \
 
70
                 { printf "0%u ", cnt++; print } \
 
71
                 /^[^#]/ { printf ".%s ", $$1; print; \
 
72
                           printf "=%s ", $$2; print; \
 
73
                           for (i = 3; i <= NF && !($$i ~ /^#/); ++i) \
 
74
                             { printf ".%s ", $$i; print } }' $^ | \
 
75
        $(MAKEDB) -o $@ -
 
76
        @echo "done."
 
77
 
 
78
$(VAR_DB)/rpc.db: $(ETC)/rpc
 
79
        @echo -n "$(patsubst %.db,%,$(@F))... "
 
80
        @$(AWK) 'BEGIN { cnt=0 } \
 
81
                 /^[ \t]*$$/ { next } \
 
82
                 /^[ \t]*#/ { next } \
 
83
                 { printf "0%u ", cnt++; print } \
 
84
                 /^[^#]/ { printf ".%s ", $$1; print; \
 
85
                           printf "=%s ", $$2; print; \
 
86
                           for (i = 3; i <= NF && !($$i ~ /^#/); ++i) \
 
87
                             { printf ".%s ", $$i; print } }' $^ | \
 
88
        $(MAKEDB) -o $@ -
 
89
        @echo "done."
 
90
 
 
91
$(VAR_DB)/services.db: $(ETC)/services
 
92
        @echo -n "$(patsubst %.db,%,$(@F))... "
 
93
        @$(AWK) 'BEGIN { FS="[ \t/]+"; cnt=0 } \
 
94
                 /^[ \t]*$$/ { next } \
 
95
                 /^[ \t]*#/ { next } \
 
96
                 { printf "0%u ", cnt++; print } \
 
97
                 /^[^#]/ { printf ".%s/%s ", $$1, $$3; print; \
 
98
                           printf ".%s/ ", $$1; print; \
 
99
                           printf "=%s/%s ", $$2, $$3; print; \
 
100
                           printf "=%s/ ", $$2; print; \
 
101
                           for (i = 4; i <= NF && !($$i ~ /^#/); ++i) \
 
102
                             { printf ".%s/%s ", $$i, $$3; print; \
 
103
                               printf ".%s/ ", $$i; print } }' $^ | \
 
104
        $(MAKEDB) -o $@ -
 
105
        @echo "done."
 
106
 
 
107
$(VAR_DB)/shadow.db: $(ETC)/shadow
 
108
        @echo -n "$(patsubst %.db,%,$(@F))... "
 
109
        @$(AWK) 'BEGIN { FS=":"; OFS=":"; cnt=0 } \
 
110
                 /^[ \t]*$$/ { next } \
 
111
                 /^[ \t]*#/ { next } \
 
112
                 { printf "0%u ", cnt++; print } \
 
113
                 /^[^#]/ { printf ".%s ", $$1; print }' $^ | \
 
114
        (umask 077 && $(MAKEDB) -o $@ -)
 
115
        @echo "done."
 
116
        @if chgrp shadow $@ 2>/dev/null; then \
 
117
          chmod g+r $@; \
 
118
        else \
 
119
          chown 0 $@; chgrp 0 $@; chmod 600 $@; \
 
120
          echo; \
 
121
          echo "Warning: The shadow password database $@"; \
 
122
          echo "has been set to be readable only by root.  You may want"; \
 
123
          echo "to make it readable by the \`shadow' group depending"; \
 
124
          echo "on your configuration."; \
 
125
          echo; \
 
126
        fi
 
127
 
 
128
$(VAR_DB)/netgroup.db: $(ETC)/netgroup
 
129
        @echo -n "$(patsubst %.db,%,$(@F))... "
 
130
        @$(AWK) 'BEGIN { cnt=0 } \
 
131
                 /^[ \t]*$$/ { next } \
 
132
                 /^[ \t]*#/ { next } \
 
133
                 { printf "0%u ", cnt++; print } \
 
134
                 /^[^#]/ { end=sub(/\\/, " "); \
 
135
                           gsub(/[ \t]+/, " "); \
 
136
                           if(end == 1) printf "%s", $$0; else print }' $^ | \
 
137
        $(MAKEDB) -o $@ -
 
138
        @echo "done."